important commands not disabled on err
parent
dc09c42923
commit
11c39b8c65
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue