disabled val on set to true

merge-requests/11/merge
Matthew 2020-05-06 19:32:51 -04:00
parent 946568a230
commit d6689132a1
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ export default class Util {
|| members.find((m) => m.username.toLowerCase().startsWith(query.toLowerCase()) || (m.nick && m.nick.toLowerCase().startsWith(query.toLowerCase())));
}
public async handleError(error: Error, message?: Message, command?: Command, disable?: boolean): Promise<void> {
public async handleError(error: Error, message?: Message, command?: Command, disable = true): Promise<void> {
try {
this.signale.error(error);
const info = { content: `\`\`\`js\n${error.stack}\n\`\`\``, embed: null };
@ -93,7 +93,7 @@ export default class Util {
const msg = message ? message.content.slice(this.client.config.prefix.length).trim().split(/ +/g) : [];
// eslint-disable-next-line no-param-reassign
if (command && disable) this.resolveCommand(msg).then((c) => { c.cmd.enabled = false; });
if (message) message.channel.createMessage(`***${this.emojis.ERROR} An unexpected error has occured - please contact a Faculty Marshal.${command && disable ? ' This command has been disabled.' : ''}***`);
if (message) message.channel.createMessage(`***${this.emojis.ERROR} An unexpected error has occured - please contact a Staff member.${command && disable ? ' This command has been disabled.' : ''}***`);
} catch (err) {
this.signale.error(err);
}