Archived
fixed guild specific commands
This commit is contained in:
1 parent
456feb703c
commit
80ac62a80f
1 file changed
+5
-13
+5
-13
@@ -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]) {
|
} else {
|
||||||
guilds[guild.id].push(
|
guilds[g] = [];
|
||||||
c.toCommandObject()
|
guilds[g].push(c.toCommandObject());
|
||||||
);
|
|
||||||
} else {
|
|
||||||
guilds[guild.id] = [];
|
|
||||||
guilds[guild.id].push(
|
|
||||||
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(
|
||||||
|
|||||||
Reference in new issue
Block a user