From 22bd0f5a429e88035e06e96a1b7ceec93d99fe1f Mon Sep 17 00:00:00 2001 From: Bsian Date: Tue, 22 Oct 2019 01:02:01 +0100 Subject: [PATCH] Added haste upload fallback so command won't disable --- src/commands/eval.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/eval.ts b/src/commands/eval.ts index be7896c..e8b55ce 100644 --- a/src/commands/eval.ts +++ b/src/commands/eval.ts @@ -36,8 +36,12 @@ export default class Eval extends Command { const display = this.client.util.splitString(output, 1975); if (display[5]) { - const { data } = await axios.post('https://snippets.cloud.libraryofcode.org/documents', display.join('')); - return message.channel.createMessage(`${this.client.stores.emojis.success} Your evaluation output can be found on https://snippets.cloud.libraryofcode.org/${data.key}`); + try { + const { data } = await axios.post('https://snippets.cloud.libraryofcode.org/documents', display.join('')); + return message.channel.createMessage(`${this.client.stores.emojis.success} Your evaluation output can be found on https://snippets.cloud.libraryofcode.org/${data.key}`); + } catch (error) { + return message.channel.createMessage(`${this.client.stores.emojis.error} ${error}`); + } } return display.forEach((m) => {