diff --git a/modules/command/commands.js b/modules/command/commands.js index 5f5e079..5bf355b 100644 --- a/modules/command/commands.js +++ b/modules/command/commands.js @@ -17,6 +17,24 @@ var commands = function(dbot) { } }, + '~commands': function(event) { + var name = event.params[1]; + if(_.has(dbot.modules, name)) { + var commands = _.keys(dbot.commands); + commands = _.filter(commands, function(cName) { + return dbot.commands[cName].module == name; + }); + event.reply(dbot.t('module_commands', { + 'module': name, + 'commands': commands.join(', ') + })); + } else { + event.reply(dbot.t('loaded_modules', { + 'modules': _.keys(dbot.modules).join(', ') + })); + } + }, + '~help': function(event) { var moduleName = event.params[1]; if(!moduleName || !_.has(dbot.modules, moduleName)) { diff --git a/modules/command/strings.json b/modules/command/strings.json index 3f531b1..3e6d5a0 100644 --- a/modules/command/strings.json +++ b/modules/command/strings.json @@ -48,5 +48,8 @@ "cy": "Modiwlau sy'n lwythodd: {modules}.", "nl": "Geladen modules: {modules}.", "de": "Module geladen: {modules}." + }, + "module_commands": { + "en": "Commands in {module}: {commands}." } }