From 688d3e82ae111adf814376c9260eb29801f94d35 Mon Sep 17 00:00:00 2001 From: Emily J Date: Sun, 18 Oct 2020 13:10:11 +1100 Subject: [PATCH] fix up unloadAll function --- bot/util/handlers.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bot/util/handlers.js b/bot/util/handlers.js index 776f1f5..d80d04a 100644 --- a/bot/util/handlers.js +++ b/bot/util/handlers.js @@ -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); }); }); }