From b17ad5042b817c663df31d38ba39aa0907fc054d Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Sun, 2 Dec 2012 16:21:37 +0000 Subject: [PATCH] added usage command --- modules/command.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/command.js b/modules/command.js index 8cd23a1..b8b75a7 100644 --- a/modules/command.js +++ b/modules/command.js @@ -53,6 +53,18 @@ var command = function(dbot) { 'name': 'command', 'ignorable': false, + 'commands': { + '~usage': function(event) { + var commandName = event.params[0]; + if(dbot.commands.hasOwnProperty(commandName)) { + event.reply('Usage for ' + commandName + ': ' + + dbot.commands[commandName].usage); + } else { + event.reply('No usage information for ' + commandName); + } + } + }, + /** * Run the appropriate command given the input. */