forked from Galactic/galactic-bot
middleware stuff
This commit is contained in:
parent
809582841e
commit
75610342fe
@ -24,6 +24,7 @@ class SlashCommandManager {
|
|||||||
if(guilds.length === 0) guilds = this.client._options.discord.slashCommands.developerGuilds;
|
if(guilds.length === 0) guilds = this.client._options.discord.slashCommands.developerGuilds;
|
||||||
|
|
||||||
const promises = [];
|
const promises = [];
|
||||||
|
//console.log(JSON.stringify(commands));
|
||||||
for(const guild of guilds) {
|
for(const guild of guilds) {
|
||||||
promises.push(this.rest.put(
|
promises.push(this.rest.put(
|
||||||
Routes.applicationGuildCommands(clientId, guild),
|
Routes.applicationGuildCommands(clientId, guild),
|
||||||
@ -35,7 +36,10 @@ class SlashCommandManager {
|
|||||||
try {
|
try {
|
||||||
result = await Promise.all(promises);
|
result = await Promise.all(promises);
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
this.client.logger.write('error', `An issue has occured while updating guild commands. Guild command refresh aborted.\n${error.stack || error}`);
|
this.client.logger.write(
|
||||||
|
'error',
|
||||||
|
`An issue has occured while updating guild commands. Guild command refresh aborted.\n${error.stack || error}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!result) return null;
|
if(!result) return null;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
const { EventEmitter } = require('events');
|
const { EventEmitter } = require('events');
|
||||||
const { Collection } = require('@discordjs/collection');
|
const { Collection } = require('@discordjs/collection');
|
||||||
const Util = require('./../../Util.js');
|
const { Util } = require('../../utilities');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user