fixed guild specific commands

This commit is contained in:
mmacierzanka committed 2021-08-07 23:44:02 +02:00
1 parent 456feb703c
commit 80ac62a80f
1 file changed
+4 -12
+4 -12
View File
@@ -128,18 +128,11 @@ export class Bot extends EventEmitter {
.filter((c) => !!c.guilds) .filter((c) => !!c.guilds)
.map((c) => { .map((c) => {
c.guilds?.map(async (g) => { c.guilds?.map(async (g) => {
const guild = await this.client.guilds.fetch(g); if (guilds[g]) {
if (guild) { guilds[g].push(c.toCommandObject());
if (guilds[guild.id]) {
guilds[guild.id].push(
c.toCommandObject()
);
} else { } else {
guilds[guild.id] = []; guilds[g] = [];
guilds[guild.id].push( guilds[g].push(c.toCommandObject());
c.toCommandObject()
);
}
} }
}); });
}); });
@@ -217,7 +210,6 @@ export class Bot extends EventEmitter {
i as CommandInteraction i as CommandInteraction
); );
} }
cmd = this.commands.fetchFromInteraction(i);
} catch (e) { } catch (e) {
if (e instanceof PermissionsError) { if (e instanceof PermissionsError) {
await this.messages.system.send( await this.messages.system.send(