diff plugins/hangman/hangman.js @ 437:722f2bbd654a

Plugin hangman: show current word on command, closes #643
author David Demelier <markand@malikania.fr>
date Sun, 16 Apr 2017 09:56:34 +0200
parents c6fbb6e0e06d
children f3c27790d0d1
line wrap: on
line diff
--- a/plugins/hangman/hangman.js	Tue Mar 07 12:20:52 2017 +0100
+++ b/plugins/hangman/hangman.js	Sun Apr 16 09:56:34 2017 +0200
@@ -40,7 +40,7 @@
     "asked":        "#{nickname}, '#{letter}' was already asked.",
     "dead":         "#{nickname}, fail the word was: #{word}.",
     "found":        "#{nickname}, nice! the word is now #{word}",
-    "running":      "#{nickname}, the game is already running.",
+    "running":      "#{nickname}, the game is already running and the word is: #{word}",
     "start":        "#{nickname}, the game is started, the word to find is: #{word}",
     "win":          "#{nickname}, congratulations, the word is #{word}.",
     "wrong-word":   "#{nickname}, this is not the word.",
@@ -342,9 +342,10 @@
     if (game) {
         var list = message.split(" \t");
 
-        if (list.length === 0 || String(list[0]).length === 0)
+        if (list.length === 0 || String(list[0]).length === 0) {
+            kw.word = game.formatWord();
             server.message(channel, Util.format(Plugin.format["running"], kw));
-        else {
+        } else {
             var word = String(list[0]);
 
             if (Hangman.isWord(word))