diff --git a/bot/bot.js b/bot/bot.js index 3228f08..c908b63 100644 --- a/bot/bot.js +++ b/bot/bot.js @@ -77,12 +77,8 @@ function checkMessageForCommand(msg, isEdit) { return; } } - let alias = aliases[cmdTxt]; - if (alias) { - var cmd = commands[alias]; - } else { - var cmd = commands[cmdTxt]; - } + + let cmd = aliases.hasOwnProperty(cmdTxt) ? commands[aliases[cmdTxt]] : commands[cmdTxt]; if (cmdTxt === 'help') { //help is special since it iterates over the other commands if (suffix) {