From f48da5bcb4b4bf7c7eafc2dac3c864cc1c226bf8 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Wed, 12 Oct 2011 17:43:53 +0100 Subject: [PATCH] kickcount --- modules/user.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/user.js b/modules/user.js index b530332..c5e9c83 100644 --- a/modules/user.js +++ b/modules/user.js @@ -9,10 +9,14 @@ var userCommands = function(dbot) { '~kickcount': function(data, params) { if(!dbot.db.kicks.hasOwnProperty(params[1])) { - dbot.say(data.channel, params[1] + ' has either never been kicked or does not exist.'); - } else { - dbot.say(data.channel, params[1] + ' has been kicked ' + dbot.db.kicks[params[1]] + ' times and has kicked people ' + dbot.db.kickers[params[1]] + ' times.'); + var kicks = '0'; } + + if(!dbot.db.kickers.hasOwnProperty(params[1])) { + var kicked = '0'; + } + + dbot.say(data.channel, params[1] + ' has been kicked ' + kicks + ' times and has kicked people ' + kicked + ' times.'); }, '~kickstats': function(data, params) {