From 53bc59455232a2b5e236a82311d7887e38574cc5 Mon Sep 17 00:00:00 2001 From: John Maguire Date: Wed, 20 Mar 2013 18:18:06 -0400 Subject: [PATCH] adding a list of modules with help info to ~help command --- modules/command/commands.js | 7 +++++++ modules/command/strings.json | 3 +++ 2 files changed, 10 insertions(+) diff --git a/modules/command/commands.js b/modules/command/commands.js index 69ec05f..68d7a28 100644 --- a/modules/command/commands.js +++ b/modules/command/commands.js @@ -19,10 +19,17 @@ var commands = function(dbot) { '~help': function(event) { var moduleName = event.params[1]; if(!moduleName) { + helpfulModules = _.filter(dbot.modules, function(element, index, array) { + return _.has(dbot.config[element], 'help'); + }); + event.reply(dbot.t('usage', { 'command': '~help', 'usage': '~help [module]' })); + event.reply(dbot.t('loaded_modules_with_help', { + 'modules': helpfulModules.join(', ') + })); return; } diff --git a/modules/command/strings.json b/modules/command/strings.json index 676532e..341aae2 100644 --- a/modules/command/strings.json +++ b/modules/command/strings.json @@ -26,5 +26,8 @@ "no_help": { "en": "No help found for {module}.", "na'vi": "Fì{module}ìri oel ke tsun run srungit" + }, + "loaded_modules_with_help": { + "en": "Loaded modules with help information: {modules}." } }