master
Kit Kasune 3 years ago
parent 4a29ebba28
commit 302da98f39
  1. 2
      bot.js
  2. 2
      util/slashmanager.js
  3. 2
      util/ts/slashmanager.ts

@ -57,8 +57,8 @@ async function init() {
client.config = auth; client.config = auth;
client.slash = new SlashManager(client).setTestServer('691122844339404800').importCommands().init(); client.slash = new SlashManager(client).setTestServer('691122844339404800').importCommands().init();
client.slash.register();
client = client.slash.client; client = client.slash.client;
client.slash.commands[0].registerToServer(client.slash.testServerId);
let mloginsp = ora(chalk.magentaBright('Connecting to Mongo client...')).start(); let mloginsp = ora(chalk.magentaBright('Connecting to Mongo client...')).start();
let pmcc = new Date().getTime(); let pmcc = new Date().getTime();

@ -20,7 +20,7 @@ class SlashManager {
let trp = commands || this.commands; let trp = commands || this.commands;
let tr = Array.isArray(trp) ? this.getCommands(trp) : this.getCommand(trp); let tr = Array.isArray(trp) ? this.getCommands(trp) : this.getCommand(trp);
return Array.isArray(tr) 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(); : this.commands[tr].registerGlobally();
} }
; ;

@ -29,7 +29,7 @@ export class SlashManager {
let trp = commands || this.commands; let trp = commands || this.commands;
let tr = Array.isArray(trp) ? this.getCommands(trp) : this.getCommand(trp); let tr = Array.isArray(trp) ? this.getCommands(trp) : this.getCommand(trp);
return Array.isArray(tr) 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(); : this.commands[tr].registerGlobally();
}; };

Loading…
Cancel
Save