From c11a7e62c3bac9a6291c5ec83b82d7c90f57bef1 Mon Sep 17 00:00:00 2001 From: Bsian Date: Sun, 1 Dec 2019 00:22:51 +0000 Subject: [PATCH] Reverting and fixing command reloader --- src/commands/load.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/load.ts b/src/commands/load.ts index 5017327..57b00df 100644 --- a/src/commands/load.ts +++ b/src/commands/load.ts @@ -22,12 +22,14 @@ export default class Load extends Command { const corepath = '/var/CloudServices/dist'; if (type === 'config') this.client.config = require(`${corepath}/config.json`); else if (type === 'util') { - const Util = require(`${corepath}/class/Util`).default; + const Util = require(`${corepath}/class/Util`); this.client.util = new Util(this.client); } else { try { - const Cmd = require(`${corepath}/commands`)[args[1]]; + const cmdIndex = require(`${corepath}/commands`); + let Cmd = cmdIndex[args[1]]; if (!Cmd) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Could not find file***`); + Cmd = require(`${corepath}/commands/${args[1]}`); this.client.commands.remove(args[1]); this.client.loadCommand(Cmd); } catch (error) {