From 84a7fc16401eea018b74a8ee0ad6452c72bfc394 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 14 Jan 2016 16:29:01 +0000 Subject: [PATCH] Tweak how command aliases are set This prevents multiple commands of the same name being returned in getCommandList() --- src/SlashCommands.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/SlashCommands.js b/src/SlashCommands.js index 83b4b52ffc..938bf062cb 100644 --- a/src/SlashCommands.js +++ b/src/SlashCommands.js @@ -318,7 +318,9 @@ var commands = { }; // helpful aliases -commands.j = commands.join; +var aliases = { + j: "join" +} module.exports = { /** @@ -338,6 +340,9 @@ module.exports = { var cmd = bits[1].substring(1).toLowerCase(); var args = bits[3]; if (cmd === "me") return null; + if (aliases[cmd]) { + cmd = aliases[cmd]; + } if (commands[cmd]) { return commands[cmd].run(roomId, args); }