From 8d7523a995b06789fdfb250977b28f6afeb185b6 Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Fri, 20 Nov 2015 00:48:36 +0100 Subject: [PATCH] fix /help --- src/lib/plugins/commands.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/plugins/commands.js b/src/lib/plugins/commands.js index edfc963..0b62452 100644 --- a/src/lib/plugins/commands.js +++ b/src/lib/plugins/commands.js @@ -9,10 +9,9 @@ module.exports.player=function(player) { var hash = player.commands.hash; if(c) { - var res = player.commands.find(params[0])[0]; - - var help = res.params.help && res.params.help(params); - return help ? '' + help : 'Information not found'; + var f=player.commands.find(c); + if(f==undefined || f.length==0) return 'Command '+c+' not found'; + return f[0].params.usage + ' ' + f[0].params.info; } else { var used = []; for(var key in hash) {