Round WPM

This commit is contained in:
Dragon Fire
2021-02-07 22:32:32 -05:00
parent 0baf9d4efe
commit 5aa5b569df
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ module.exports = class TypingRaceCommand extends Command {
if (!winner.size) return msg.say('Oh... No one won.');
const wpm = (sentence.length / 5) / ((newScore / 1000) / 60);
return msg.say(stripIndents`
The winner is ${winner.first().author}! (Took ${newScore / 1000} seconds, ${wpm} WPM)
The winner is ${winner.first().author}! (Took ${newScore / 1000} seconds, ${Math.round(wpm)} WPM)
${scoreBeat ? `**New High Score!** Old:` : `High Score:`} ${highScore / 1000} (Held by ${user})
`);
} catch (err) {
+1 -1
View File
@@ -41,7 +41,7 @@ module.exports = class TypingTestCommand extends Command {
if (msgs.first().content.toLowerCase() !== sentence) return msg.reply('Sorry! You made a typo, so you lose!');
const wpm = (sentence.length / 5) / ((newScore / 1000) / 60);
return msg.reply(stripIndents`
Nice job! 10/10! You deserve some cake! (Took ${newScore / 1000} seconds, ${wpm} WPM)
Nice job! 10/10! You deserve some cake! (Took ${newScore / 1000} seconds, ${Math.round(wpm)} WPM)
${scoreBeat ? `**New High Score!** Old:` : `High Score:`} ${highScore / 1000} (Held by ${user})
`);
}