From 604e0992334bffd4c247d4369879cfd7a6a1a7f8 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Fri, 23 Feb 2018 01:12:16 +0000 Subject: [PATCH] Fix shuffling so that B isn't always correct in boolean --- commands/games/quiz.js | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/games/quiz.js b/commands/games/quiz.js index d954968d..7db1a35d 100644 --- a/commands/games/quiz.js +++ b/commands/games/quiz.js @@ -58,11 +58,11 @@ module.exports = class QuizCommand extends Command { const answers = body.results[0].incorrect_answers.map(answer => decodeURIComponent(answer.toLowerCase())); const correct = decodeURIComponent(body.results[0].correct_answer.toLowerCase()); answers.push(correct); - const answerList = type === 'boolean' ? answers : shuffle(answers); + const shuffled = shuffle(answers); await msg.say(stripIndents` **You have 15 seconds to answer this question.** ${decodeURIComponent(body.results[0].question)} - ${answerList.map((answer, i) => `**${choices[i]}**. ${answer}`).join('\n')} + ${shuffled.map((answer, i) => `**${choices[i]}**. ${answer}`).join('\n')} `); const filter = res => res.author.id === msg.author.id && choices.includes(res.content.toUpperCase()); const msgs = await msg.channel.awaitMessages(filter, { @@ -70,7 +70,7 @@ module.exports = class QuizCommand extends Command { time: 15000 }); if (!msgs.size) return msg.say(`Sorry, time is up! It was ${correct}.`); - const win = answerList[choices.indexOf(msgs.first().content.toUpperCase())] === correct; + const win = shuffled[choices.indexOf(msgs.first().content.toUpperCase())] === correct; if (!win) return msg.say(`Nope, sorry, it's ${correct}.`); return msg.say('Nice job! 10/10! You deserve some cake!'); } catch (err) { diff --git a/package.json b/package.json index 2eaf5beb..c4b9bf5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "66.4.0", + "version": "66.4.1", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {