From e283251e6892223c35d9ae24737d124bdaba932c Mon Sep 17 00:00:00 2001 From: Bsian Date: Sat, 19 Oct 2019 14:32:10 +0100 Subject: [PATCH] Added error catcher --- src/commands/help.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/commands/help.ts b/src/commands/help.ts index ff7fb35..412700a 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -16,7 +16,8 @@ export default class Help extends Command { util: Util = new Util(this.client); public async run(message: Message, args?: string[]) { - const cmd = args.filter((c) => c)[0]; + try { + const cmd = args.filter((c) => c)[0]; if (!cmd) { const cmdList: Command[] = []; this.client.commands.forEach((c) => cmdList.push(c)); @@ -61,5 +62,8 @@ export default class Help extends Command { embed.setDescription(description); // @ts-ignore return message.channel.createMessage({ embed }); + } catch (error) { + this.util.handleError(error, message, this) + } } }