disabled val on set to true
parent
946568a230
commit
d6689132a1
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue