diff --git a/commands/games-mp/typing-race.js b/commands/games-mp/typing-race.js index a47633d7..c18d243a 100644 --- a/commands/games-mp/typing-race.js +++ b/commands/games-mp/typing-race.js @@ -48,7 +48,7 @@ module.exports = class TypingRaceCommand extends Command { const highScoreGet = await this.client.redis.get('typing-test'); const highScore = highScoreGet ? Number.parseInt(highScoreGet, 10) : null; const highScoreUser = await this.client.redis.get('typing-test-user'); - const scoreBeat = !highScore || highScore > newScore; + const scoreBeat = winner.size && (!highScore || highScore > newScore); const user = await fetchHSUserDisplay(this.client, highScoreUser); if (scoreBeat) { await this.client.redis.set('typing-test', newScore); diff --git a/commands/games-sp/typing-test.js b/commands/games-sp/typing-test.js index 2eee6977..8d111961 100644 --- a/commands/games-sp/typing-test.js +++ b/commands/games-sp/typing-test.js @@ -46,11 +46,12 @@ module.exports = class TypingTestCommand extends Command { max: 1, time }); + const win = msgs.size && msgs.first().content === sentence; const newScore = Date.now() - now; const highScoreGet = await this.client.redis.get('typing-test'); const highScore = highScoreGet ? Number.parseInt(highScoreGet, 10) : null; const highScoreUser = await this.client.redis.get('typing-test-user'); - const scoreBeat = !highScore || highScore > newScore; + const scoreBeat = win && (!highScore || highScore > newScore); const user = await fetchHSUserDisplay(this.client, highScoreUser); if (scoreBeat) { await this.client.redis.set('typing-test', newScore);