From aae37e1f8794e55fde511a3115a556e0c408554a Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 31 Jan 2021 13:20:37 -0500 Subject: [PATCH] Remove difficulty from typing-test --- README.md | 2 +- commands/games-sp/typing-test.js | 30 +++++------------------------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index e17301ca..902d09e5 100644 --- a/README.md +++ b/README.md @@ -598,7 +598,7 @@ Total: 588 * **sorting-hat:** Take a quiz to determine your Hogwarts house. * **the-game:** If you think about the game, you lose. * **true-or-false:** Answer a true or false question. -* **typing-test:** See how fast you can type a sentence in a given time limit. +* **typing-test:** See how fast you can type a sentence. * **waldo:** Try to find Waldo with spoiler tags! * **whos-that-pokemon-cry:** Guess who that Pokémon is, based on their cry. * **whos-that-pokemon:** Guess who that Pokémon is, based on their silhouette. diff --git a/commands/games-sp/typing-test.js b/commands/games-sp/typing-test.js index eb4bbe25..93eaa85d 100644 --- a/commands/games-sp/typing-test.js +++ b/commands/games-sp/typing-test.js @@ -2,18 +2,9 @@ const Command = require('../../structures/Command'); const { createCanvas, registerFont } = require('canvas'); const { stripIndents } = require('common-tags'); const path = require('path'); -const { list, fetchHSUserDisplay } = require('../../util/Util'); +const { fetchHSUserDisplay } = require('../../util/Util'); const words = require('../../assets/json/word-list'); registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-Regular.ttf'), { family: 'Noto' }); -const difficulties = ['baby', 'easy', 'medium', 'hard', 'extreme', 'impossible']; -const times = { - baby: 60000, - easy: 25000, - medium: 20000, - hard: 15000, - extreme: 10000, - impossible: 5000 -}; module.exports = class TypingTestCommand extends Command { constructor(client) { @@ -21,30 +12,19 @@ module.exports = class TypingTestCommand extends Command { name: 'typing-test', group: 'games-sp', memberName: 'typing-test', - description: 'See how fast you can type a sentence in a given time limit.', - details: `**Difficulties:** ${difficulties.join(', ')}`, - args: [ - { - key: 'difficulty', - prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`, - type: 'string', - oneOf: difficulties, - parse: difficulty => difficulty.toLowerCase() - } - ] + description: 'See how fast you can type a sentence.' }); } - async run(msg, { difficulty }) { + async run(msg) { const sentence = this.generateSentence(5); - const time = times[difficulty]; - await msg.reply(`**You have ${time / 1000} seconds to type this sentence.**`, { + await msg.reply(`**You have 30 seconds to type this sentence.**`, { files: [{ attachment: this.generateImage(sentence), name: 'typing-test.png' }] }); const now = Date.now(); const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, { max: 1, - time + time: 30000 }); const win = msgs.size && msgs.first().content.toLowerCase() === sentence; const newScore = Date.now() - now;