diff --git a/modules/command/command.js b/modules/command/command.js index ff530ff..7c0dfcc 100644 --- a/modules/command/command.js +++ b/modules/command/command.js @@ -57,10 +57,34 @@ var command = function(dbot) { '~usage': function(event) { var commandName = event.params[1]; if(dbot.usage.hasOwnProperty(commandName)) { - event.reply('Usage for ' + commandName + ': ' + - dbot.usage[commandName]); + event.reply(dbot.t('usage', { + 'command': commandName, + 'usage': dbot.usage[commandName] + })); } else { - event.reply('No usage information for ' + commandName); + event.reply(dbot.t('no_usage_info', { + 'command': commandName + })); + } + }, + + '~help': function(event) { + var moduleName = event.params[1]; + if(!dbot.modules.hasOwnProperty(moduleName)) { + var moduleName = dbot.commandMap[moduleName]; + } + + if(moduleName && dbot.config[moduleName].hasOwnProperty('help')) { + var help = dbot.config[modulename].help; + event.reply(dbot.t('help_link', { + 'module': moduleName, + 'link': help + })); + } else { + if(!moduleName) { + moduleName = event.params[1]; + } + event.reply(dbot.t('no_help', { 'module': moduleName })) } } }, diff --git a/modules/command/strings.json b/modules/command/strings.json index 975c0ad..922eb63 100644 --- a/modules/command/strings.json +++ b/modules/command/strings.json @@ -11,7 +11,16 @@ "na'vi": "NgeyƤ pamrel keyawr lu. Nga skxawng lu.", "welsh": "Cystrawen annilys. Cychwyn orfflosgiad" }, + "usage": { + "english": "Usage for {command}: {usage}." + }, "no_usage_info": { - "No usage information found for {command}." + "english": "No usage information found for {command}." + }, + "help_link": { + "english": "Help for {module}: {link}." + }, + "no_help": { + "english": "No help found for {module}." } }