added usage command

This commit is contained in:
Luke Slater 2012-12-02 16:21:37 +00:00
parent 1ad20e9606
commit b17ad5042b

View File

@ -53,6 +53,18 @@ var command = function(dbot) {
'name': 'command', 'name': 'command',
'ignorable': false, '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. * Run the appropriate command given the input.
*/ */