From e7437d4b59ddba3067a5df040e32f54f957d16db Mon Sep 17 00:00:00 2001 From: Bsian Date: Tue, 29 Oct 2019 20:16:08 +0000 Subject: [PATCH] Fixed exec failure --- src/commands/exec.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/commands/exec.ts b/src/commands/exec.ts index 6728171..17ae8ca 100644 --- a/src/commands/exec.ts +++ b/src/commands/exec.ts @@ -18,7 +18,12 @@ export default class Exec extends Command { if (!args.length) return this.client.commands.get('help').run(message, [this.name]); const response = await message.channel.createMessage(`${this.client.stores.emojis.loading} ***Executing \`${args.join(' ')}\`***`); - const result = await this.client.util.exec(args.join(' ')); + let result: string; + try { + result = await this.client.util.exec(args.join(' ')); + } catch (error) { + result = error.message; + } if (result.length <= 1975) return response.edit(`\`\`\`bash\n${result}\n\`\`\``); const splitResult = this.client.util.splitString(result, 1975);