more code safety on register

This commit is contained in:
mmacierzanka committed 2021-08-26 14:39:10 +02:00
1 parent 4dc6556731
commit 77f503381b
1 file changed
+1 -1
+1 -1
View File
@@ -108,7 +108,7 @@ export class Bot extends EventEmitter {
process.stdout.write("Registering commands... ");
await axios.put(
`https://discord.com/api/v8/applications/${this.applicationId}/commands`,
this.commands.list.filter((c) => !c.guilds && c.slash).map((c) => (!c.guilds ? c.toCommandObject() : {})),
this.commands.list.filter((c) => !Array.isArray(c.guilds) && c.slash).map((c) => c.toCommandObject()),
{ headers: { Authorization: `Bot ${this.token}` } }
);
const guilds: any = {};