From 01e20a1f16ef4b581054c0d750810228aaaddea3 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Mon, 7 Jun 2021 18:05:46 -0400 Subject: [PATCH] Fix --- commands/games-sp/true-or-false.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/games-sp/true-or-false.js b/commands/games-sp/true-or-false.js index d66664ad..be56f968 100644 --- a/commands/games-sp/true-or-false.js +++ b/commands/games-sp/true-or-false.js @@ -52,21 +52,21 @@ module.exports = class TrueOrFalseCommand extends Command { new MessageButton().setCustomID('true').setStyle('SUCCESS').setLabel('True'), new MessageButton().setCustomID('false').setStyle('DANGER').setLabel('False') ); - await msg.reply(stripIndents` + const questionMsg = await msg.reply(stripIndents` **You have 15 seconds to answer this question.** ${decodeURIComponent(body.results[0].question)} `, { components: [row] }); const filter = res => res.author.id !== msg.author.id; - const interactions = await msg.awaitMessageComponentInteractions(filter, { + const interactions = await questionMsg.awaitMessageComponentInteractions(filter, { max: 1, time: 15000 }); - if (!interactions.size) return msg.edit(`Sorry, time is up! It was ${correctBool}.`, { components: [] }); + if (!interactions.size) return questionMsg.edit(`Sorry, time is up! It was ${correctBool}.`, { components: [] }); const ans = interactions.first().customID === 'true'; - if (correctBool !== ans) return msg.edit(`Nope, sorry, it's ${correctBool}.`, { components: [] }); - return msg.edit('Nice job! 10/10! You deserve some cake!', { components: [] }); + if (correctBool !== ans) return questionMsg.edit(`Nope, sorry, it's ${correctBool}.`, { components: [] }); + return questionMsg.edit('Nice job! 10/10! You deserve some cake!', { components: [] }); } catch (err) { - return msg.edit(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); + return questionMsg.edit(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } } };