From b641dcd34a5c37d639989d19ff4106385d73ab8b Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Tue, 11 Dec 2012 20:31:11 +0000 Subject: [PATCH] usage info in command --- modules/command/command.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/command/command.js b/modules/command/command.js index ea3043d..6342da2 100644 --- a/modules/command/command.js +++ b/modules/command/command.js @@ -56,10 +56,9 @@ var command = function(dbot) { 'commands': { '~usage': function(event) { var commandName = event.params[1]; - console.log(commandName); - if(dbot.commands.hasOwnProperty(commandName)) { + if(dbot.usage.hasOwnProperty(commandName)) { event.reply('Usage for ' + commandName + ': ' + - dbot.commands[commandName].usage); + dbot.usage[commandName]); } else { event.reply('No usage information for ' + commandName); } @@ -84,8 +83,8 @@ var command = function(dbot) { dbot.save(); } else { if(commandName !== '~') { - if(dbot.commands[commandName].hasOwnProperty('usage')){ - event.reply('Usage: ' + dbot.commands[commandName].usage); + if(dbot.usage.hasOwnProperty(commandName)){ + event.reply('Usage: ' + dbot.usage[commandName]); } else { event.reply(dbot.t('syntax_error')); }