From 302da98f397f507f88e0bbcc0bd9f16dde553d6c Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Mon, 30 Aug 2021 21:27:14 -0600 Subject: [PATCH] buggies --- bot.js | 2 +- util/slashmanager.js | 2 +- util/ts/slashmanager.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.js b/bot.js index 29ec8ec..1d6b0ce 100644 --- a/bot.js +++ b/bot.js @@ -57,8 +57,8 @@ async function init() { client.config = auth; client.slash = new SlashManager(client).setTestServer('691122844339404800').importCommands().init(); + client.slash.register(); client = client.slash.client; - client.slash.commands[0].registerToServer(client.slash.testServerId); let mloginsp = ora(chalk.magentaBright('Connecting to Mongo client...')).start(); let pmcc = new Date().getTime(); diff --git a/util/slashmanager.js b/util/slashmanager.js index b685582..d4b392a 100644 --- a/util/slashmanager.js +++ b/util/slashmanager.js @@ -20,7 +20,7 @@ class SlashManager { let trp = commands || this.commands; let tr = Array.isArray(trp) ? this.getCommands(trp) : this.getCommand(trp); return Array.isArray(tr) - ? this.rest.put(v9_1.Routes.applicationCommands(this.client.user.id), { body: [(() => { let t = []; tr.forEach(trt => t.push(this.commands[trt].command.toJSON())); return t; })()] }) + ? this.rest.put(v9_1.Routes.applicationCommands(this.client.user.id), { body: (() => { let t = []; tr.forEach(trt => t.push(this.commands[trt].command.toJSON())); return t; })() }) : this.commands[tr].registerGlobally(); } ; diff --git a/util/ts/slashmanager.ts b/util/ts/slashmanager.ts index 36ef77d..5b9fd04 100644 --- a/util/ts/slashmanager.ts +++ b/util/ts/slashmanager.ts @@ -29,7 +29,7 @@ export class SlashManager { let trp = commands || this.commands; let tr = Array.isArray(trp) ? this.getCommands(trp) : this.getCommand(trp); return Array.isArray(tr) - ? this.rest.put(Routes.applicationCommands(this.client.user.id), {body: [(() => {let t = []; tr.forEach(trt => t.push(this.commands[trt].command.toJSON())); return t;})()]}) + ? this.rest.put(Routes.applicationCommands(this.client.user.id), {body: (() => {let t = []; tr.forEach(trt => t.push(this.commands[trt].command.toJSON())); return t;})()}) : this.commands[tr].registerGlobally(); };