From 63d93f8c7b64d59c24ea0206cbe776ab974a31ec Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 19 Sep 2017 21:33:17 +0000 Subject: [PATCH] Beep --- commands/games/akinator.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/commands/games/akinator.js b/commands/games/akinator.js index 4d6c01b2..6fcdbace 100644 --- a/commands/games/akinator.js +++ b/commands/games/akinator.js @@ -19,12 +19,10 @@ module.exports = class AkinatorCommand extends Command { if (this.sessions.has(msg.channel.id)) return msg.say('Only one game may be occuring per channel.'); try { let ans = null; - this.sessions.set(msg.channel.id, { - progress: null, - step: 0 - }); - while (this.sessions.get(msg.channel.id).progress < 99 && ++this.sessions.get(msg.channel.id).step <= 80) { + this.sessions.set(msg.channel.id, { progress: null }); + while (this.sessions.get(msg.channel.id).progress < 99) { const data = ans === null ? await this.createSession(msg.channel) : await this.progress(msg.channel, ans); + if (this.sessions.get(msg.channel.id).step <= 80) break; const answers = data.answers.map(answer => answer.answer.toLowerCase()); await msg.say(stripIndents` **${++data.step}.** ${data.question}