disabled val on set to true

merge-requests/12/head
Matthew 2020-05-06 19:32:51 -04:00 committed by Bsian
parent 8589cd2068
commit 41b006557b
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
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()))); || 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 { try {
this.signale.error(error); this.signale.error(error);
const info = { content: `\`\`\`js\n${error.stack}\n\`\`\``, embed: null }; 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) : []; const msg = message ? message.content.slice(this.client.config.prefix.length).trim().split(/ +/g) : [];
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
if (command && disable) this.resolveCommand(msg).then((c) => { c.cmd.enabled = false; }); 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) { } catch (err) {
this.signale.error(err); this.signale.error(err);
} }