forked from GitHub/dbot
adding a list of modules with help info to ~help command
This commit is contained in:
parent
163209afb9
commit
53bc594552
@ -19,10 +19,17 @@ var commands = function(dbot) {
|
|||||||
'~help': function(event) {
|
'~help': function(event) {
|
||||||
var moduleName = event.params[1];
|
var moduleName = event.params[1];
|
||||||
if(!moduleName) {
|
if(!moduleName) {
|
||||||
|
helpfulModules = _.filter(dbot.modules, function(element, index, array) {
|
||||||
|
return _.has(dbot.config[element], 'help');
|
||||||
|
});
|
||||||
|
|
||||||
event.reply(dbot.t('usage', {
|
event.reply(dbot.t('usage', {
|
||||||
'command': '~help',
|
'command': '~help',
|
||||||
'usage': '~help [module]'
|
'usage': '~help [module]'
|
||||||
}));
|
}));
|
||||||
|
event.reply(dbot.t('loaded_modules_with_help', {
|
||||||
|
'modules': helpfulModules.join(', ')
|
||||||
|
}));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,5 +26,8 @@
|
|||||||
"no_help": {
|
"no_help": {
|
||||||
"en": "No help found for {module}.",
|
"en": "No help found for {module}.",
|
||||||
"na'vi": "Fì{module}ìri oel ke tsun run srungit"
|
"na'vi": "Fì{module}ìri oel ke tsun run srungit"
|
||||||
|
},
|
||||||
|
"loaded_modules_with_help": {
|
||||||
|
"en": "Loaded modules with help information: {modules}."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user