diff --git a/modules/command/commands.js b/modules/command/commands.js index 96ac77a..69ec05f 100644 --- a/modules/command/commands.js +++ b/modules/command/commands.js @@ -18,8 +18,20 @@ var commands = function(dbot) { '~help': function(event) { var moduleName = event.params[1]; + if(!moduleName) { + event.reply(dbot.t('usage', { + 'command': '~help', + 'usage': '~help [module]' + })); + return; + } + if(!_.has(dbot.modules, moduleName)) { - var moduleName = dbot.commands[moduleName].module; + if(_.has(dbot.commands, moduleName)) { + var moduleName = dbot.commands[moduleName].module; + } else { + var moduleName = undefined; + } } if(moduleName && _.has(dbot.config[moduleName], 'help')) {