From 62cb43829b11508b95fbd55ea812c11736ba13ff Mon Sep 17 00:00:00 2001 From: Bsian Date: Thu, 31 Oct 2019 23:00:14 +0000 Subject: [PATCH] Updated error handler for subcommands --- src/class/Util.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index 8feb58e..a2eb627 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -96,7 +96,10 @@ export default class Util { info.embed = embed; } await this.client.createMessage('595788220764127272', info); - if (command) this.client.commands.get(command.name).enabled = false; + const msg = message.content.slice(this.client.config.prefix.length).trim().split(/ +/g); + const label = msg[0]; + const args = msg.slice(1); + if (command) this.resolveCommand(label, args).then((c) => { c.cmd.enabled = false; }); if (message) message.channel.createMessage(`***${this.client.stores.emojis.error} An unexpected error has occured - please contact a member of the Engineering Team.${command ? ' This command has been disabled.' : ''}***`); } catch (err) { this.client.signale.error(err);