diff plugins/hangman/hangman.js @ 847:a23b7b574ed2

irccd: rename [format] section to [templates], closes #1671
author David Demelier <markand@malikania.fr>
date Wed, 10 Jul 2019 20:10:00 +0200
parents 06cc2f95f479
children 5e25439fe98d
line wrap: on
line diff
--- a/plugins/hangman/hangman.js	Wed Jul 10 13:39:20 2019 +0200
+++ b/plugins/hangman/hangman.js	Wed Jul 10 20:10:00 2019 +0200
@@ -37,7 +37,7 @@
 Plugin.config["collaborative"] = "true";
 
 // Formats.
-Plugin.format = {
+Plugin.templates = {
 	"asked":        "#{nickname}, '#{letter}' was already asked.",
 	"dead":         "#{nickname}, fail the word was: #{word}.",
 	"found":        "#{nickname}, nice! the word is now #{word}",
@@ -284,7 +284,7 @@
 	switch (st) {
 	case "found":
 		kw.word = game.formatWord();
-		server.message(channel, Util.format(Plugin.format["found"], kw));
+		server.message(channel, Util.format(Plugin.templates["found"], kw));
 		break;
 	case "wrong-letter":
 	case "wrong-player":
@@ -292,12 +292,12 @@
 		kw.word = proposition;
 	case "asked":
 		kw.letter = String.fromCharCode(proposition);
-		server.message(channel, Util.format(Plugin.format[st], kw));
+		server.message(channel, Util.format(Plugin.templates[st], kw));
 		break;
 	case "dead":
 	case "win":
 		kw.word = game.word;
-		server.message(channel, Util.format(Plugin.format[st], kw));
+		server.message(channel, Util.format(Plugin.templates[st], kw));
 
 		// Remove the game.
 		Hangman.remove(game);
@@ -331,7 +331,7 @@
 
 		if (list.length === 0 || String(list[0]).length === 0) {
 			kw.word = game.formatWord();
-			server.message(channel, Util.format(Plugin.format["running"], kw));
+			server.message(channel, Util.format(Plugin.templates["running"], kw));
 		} else {
 			var word = String(list[0]);
 
@@ -342,7 +342,7 @@
 		game = Hangman.create(server, channel);
 		game.query = isquery;
 		kw.word = game.formatWord();
-		server.message(channel, Util.format(Plugin.format["start"], kw));
+		server.message(channel, Util.format(Plugin.templates["start"], kw));
 	}
 
 	return game;