From 60c6f84702c57308d7aea7a223e8bbaa85fca3cd Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Tue, 16 Nov 2021 00:12:55 +0100 Subject: [PATCH] Fixed playing a word without ongoing mash crashing bot. --- src/games/mash.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/games/mash.js b/src/games/mash.js index 7b40095..acb2c13 100644 --- a/src/games/mash.js +++ b/src/games/mash.js @@ -172,13 +172,13 @@ function onCommand(args, context) { return; } - if (!word && !mash) { - context.sendMessage(`Start a mash with ${config.prefix}mash {length}`, context.room.id); + if (!word && mash) { + context.sendMessage(`The current mash is: **${mash.anagram}**`, context.room.id); return; } - if (!word && mash) { - context.sendMessage(`The current mash is: **${mash.anagram}**`, context.room.id); + if (!word || !mash) { + context.sendMessage(`Start a mash with ${config.prefix}mash {length}`, context.room.id); return; }