From 32c88c512dedb7abb070718b4dd4dc6804db2016 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sun, 16 May 2021 09:07:54 -0500 Subject: [PATCH] Fix callback catch blocks to perform actions other than logging to the console --- bot/awesomescibo.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/bot/awesomescibo.js b/bot/awesomescibo.js index c63f533..23bd4ca 100755 --- a/bot/awesomescibo.js +++ b/bot/awesomescibo.js @@ -235,21 +235,17 @@ function training(subject, interaction) { overrideMsg .awaitReactions(filter, { max: 1, - time: 600000, - errors: ["time"], }) .then((userReaction) => { updateScore(true, score, authorId).then((msgToReply) => answerMsg.reply(msgToReply) ); - }); - }) + }).catch(console.error); + }).catch(console.error); } - }) - .catch(console.error); - }); - }) - .catch(console.error); + }).catch(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!")); } function sendHelpMessage(interaction) {