From 1480e3d2a4c81d8de10fe1555fbd2e27af9ff99b Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 13 Aug 2018 02:17:26 +0900 Subject: [PATCH] Fix bug --- src/modules/guessing-game/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/guessing-game/index.ts b/src/modules/guessing-game/index.ts index 600cac8..00b1b0f 100644 --- a/src/modules/guessing-game/index.ts +++ b/src/modules/guessing-game/index.ts @@ -91,6 +91,8 @@ export default class GuessingGameModule implements IModule { const firsttime = exist.tries.indexOf(g) === -1; + exist.tries.push(g); + let text: string; let end = false; @@ -110,13 +112,11 @@ export default class GuessingGameModule implements IModule { if (end) { exist.isEnded = true; exist.endedAt = Date.now(); - guesses.update(exist); this.ai.unsubscribeReply(this, msg.userId); - } else { - exist.tries.push(g); - guesses.update(exist); } + guesses.update(exist); + msg.reply(text).then(reply => { if (!end) { this.ai.subscribeReply(this, msg.userId, msg.isMessage, reply.id);