mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Add WPM to typing-race/typing-test
This commit is contained in:
@@ -262,7 +262,7 @@ in the appropriate channel's topic to use it.
|
||||
|
||||
## Commands
|
||||
|
||||
Total: 594
|
||||
Total: 593
|
||||
|
||||
### Utility:
|
||||
|
||||
|
||||
@@ -59,8 +59,9 @@ module.exports = class TypingRaceCommand extends Command {
|
||||
}
|
||||
this.client.games.delete(msg.channel.id);
|
||||
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)
|
||||
The winner is ${winner.first().author}! (Took ${newScore / 1000} seconds, ${wpm} WPM)
|
||||
${scoreBeat ? `**New High Score!** Old:` : `High Score:`} ${highScore / 1000} (Held by ${user})
|
||||
`);
|
||||
} catch (err) {
|
||||
|
||||
@@ -39,8 +39,9 @@ module.exports = class TypingTestCommand extends Command {
|
||||
}
|
||||
if (!msgs.size) return msg.reply('Sorry! You lose!');
|
||||
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)
|
||||
Nice job! 10/10! You deserve some cake! (Took ${newScore / 1000} seconds, ${wpm} WPM)
|
||||
${scoreBeat ? `**New High Score!** Old:` : `High Score:`} ${highScore / 1000} (Held by ${user})
|
||||
`);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "129.0.0",
|
||||
"version": "129.0.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user