From 083382459aa59723aad937e31c179d4f0a44576b Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sun, 16 May 2021 09:09:22 -0500 Subject: [PATCH] Attempt to fix catch blocks always replying with errors --- bot/awesomescibo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/awesomescibo.js b/bot/awesomescibo.js index 23bd4ca..69aab37 100755 --- a/bot/awesomescibo.js +++ b/bot/awesomescibo.js @@ -243,9 +243,9 @@ function training(subject, interaction) { }).catch(console.error); }).catch(console.error); } - }).catch(interaction.editReply("Sorry, the question timed out waiting for an answer.")); + }).catch(error => if (error) interaction.editReply("Sorry, the question timed out waiting for an answer.")); }).catch(console.error); - }).catch(interaction.reply("Sorry, there was a problem fetching the question. Please try again!")); + }).catch(error => if (error) interaction.reply("Sorry, there was a problem fetching the question. Please try again!")); } function sendHelpMessage(interaction) {