Added rudimentary Trivia game.

This commit is contained in:
2021-11-06 01:33:52 +01:00
parent 14fb0f90bf
commit 09f1f5a14a
8 changed files with 231 additions and 5 deletions

View File

@@ -48,7 +48,9 @@ function start(length, context, attempt = 0) {
context.logger.info(`Mash started, '${anagram}' with answers ${answers.map((answer) => `'${answer.word}'`).join(', ')}`);
}
function play(word, context) {
function play(rawWord, context) {
const word = rawWord.toLowerCase();
if (word.length !== mash.key.length) {
context.sendMessage(`Your answer needs to be ${mash.key.length} letters, @${context.user.username}`, context.room.id);
return;