From 7c9be2d02eaf99044acf6c9e0cd9eab07f82e113 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 29 May 2020 18:14:31 -0400 Subject: [PATCH] Fix --- commands/games-sp/anagramica.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands/games-sp/anagramica.js b/commands/games-sp/anagramica.js index cb87d204..702a05cf 100644 --- a/commands/games-sp/anagramica.js +++ b/commands/games-sp/anagramica.js @@ -42,16 +42,20 @@ module.exports = class AnagramicaCommand extends Command { **You have ${time} seconds to provide anagrams for the following letters:** ${letters.map(letter => `\`${letter.toUpperCase()}\``).join(' ')} `); + const picked = []; const filter = res => { if (res.author.id !== msg.author.id) return false; + if (picked.includes(res.content.toLowerCase())) return false; const score = this.getScore(letters, res.content.toLowerCase()); if (!score) return false; if (!valid.includes(res.content.toLowerCase())) { points -= score; + picked.push(res.content.toLowerCase()); res.react(FAILURE_EMOJI_ID || '❌').catch(() => null); return false; } points += score; + picked.push(res.content.toLowerCase()); res.react(SUCCESS_EMOJI_ID || '✅').catch(() => null); return true; };