1
0
Fork 0

Added error catcher

refactor/models
Bsian 2019-10-19 14:32:10 +01:00
parent 384adae1de
commit e283251e68
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 5 additions and 1 deletions

View File

@ -16,7 +16,8 @@ export default class Help extends Command {
util: Util = new Util(this.client); util: Util = new Util(this.client);
public async run(message: Message, args?: string[]) { public async run(message: Message, args?: string[]) {
const cmd = args.filter((c) => c)[0]; try {
const cmd = args.filter((c) => c)[0];
if (!cmd) { if (!cmd) {
const cmdList: Command[] = []; const cmdList: Command[] = [];
this.client.commands.forEach((c) => cmdList.push(c)); this.client.commands.forEach((c) => cmdList.push(c));
@ -61,5 +62,8 @@ export default class Help extends Command {
embed.setDescription(description); embed.setDescription(description);
// @ts-ignore // @ts-ignore
return message.channel.createMessage({ embed }); return message.channel.createMessage({ embed });
} catch (error) {
this.util.handleError(error, message, this)
}
} }
} }