1
0
Fork 0

Updated error handler for subcommands

refactor/models
Bsian 2019-10-31 23:00:14 +00:00
parent f8a600535b
commit 62cb43829b
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 4 additions and 1 deletions

View File

@ -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);