fix up unloadAll function
This commit is contained in:
parent
e0fb1c5ed7
commit
688d3e82ae
1 changed files with 3 additions and 5 deletions
|
@ -49,7 +49,7 @@ class CommandHandler {
|
|||
this.client.logger.info(`Loaded a total of ${this.client.commands.size} commands.`);
|
||||
}
|
||||
|
||||
async unload (name, category) {
|
||||
unload (name, category) {
|
||||
const path = this.client.path + '/commands/' + category + '/' + name + '.js';
|
||||
|
||||
let command;
|
||||
|
@ -78,10 +78,8 @@ class CommandHandler {
|
|||
const commandFiles = fs.readdirSync('./commands/' + dir + '/');
|
||||
commandFiles.filter((cmd) => cmd.split('.').pop() === 'js').forEach((cmd) => {
|
||||
cmd = cmd.substring(0, cmd.length - 3);
|
||||
const resp = this.unload(cmd, dir);
|
||||
if (resp) {
|
||||
this.client.logger.error(resp);
|
||||
}
|
||||
const res = this.unload(cmd, dir);
|
||||
if (res) this.client.logger.error(res);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue