important commands not disabled on err

merge-requests/5/head
Matthew 2020-04-15 15:33:27 -04:00
parent dc09c42923
commit 11c39b8c65
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
2 changed files with 5 additions and 3 deletions

View File

@ -15,7 +15,9 @@ export default class Moderation {
constructor(client: Client) {
this.client = client;
this.logChannels.modlogs = channels.modlogs;
this.logChannels = {
modlogs: channels.modlogs,
};
}
public checkPermissions(member: Member, moderator: Member): boolean {

View File

@ -96,7 +96,7 @@ export default class Util {
return member;
}
public async handleError(error: Error, message?: Message, command?: Command): Promise<void> {
public async handleError(error: Error, message?: Message, command?: Command, disable?: boolean): Promise<void> {
try {
this.signale.error(error);
const info = { content: `\`\`\`js\n${error.stack}\n\`\`\``, embed: null };
@ -118,7 +118,7 @@ export default class Util {
await this.client.createMessage('595788220764127272', info);
const msg = message.content.slice(this.client.config.prefix.length).trim().split(/ +/g);
// eslint-disable-next-line no-param-reassign
if (command) 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 ? ' This command has been disabled.' : ''}***`);
} catch (err) {
this.signale.error(err);