From 04dc9019743b134da9cd33ce19684688ff500cec Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Wed, 12 Oct 2011 17:40:21 +0100 Subject: [PATCH] kickers --- modules/kick.js | 9 ++++++++- modules/user.js | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/kick.js b/modules/kick.js index a168ef5..1bb4c46 100644 --- a/modules/kick.js +++ b/modules/kick.js @@ -4,7 +4,7 @@ var kick = function(dbot) { return { 'listener': function(data) { if(data.kickee == dbot.name) { - dbot.instance.join(data.channel); // TODO: make interface + dbot.instance.join(data.channel); dbot.say(data.channel, 'Thou shalt not kick ' + dbot.name); dbot.db.kicks[dbot.name] += 1; } else { @@ -13,6 +13,13 @@ var kick = function(dbot) { } else { dbot.db.kicks[data.kickee] += 1; } + + if(!dbot.db.kickers.hasOwnProperty(data.user)) { + dbot.db.kickers[data.user] = 1; + } else { + dbot.db.kickers[data.user] += 1; + } + dbot.say(data.channel, data.kickee + '-- (' + data.kickee + ' has been kicked ' + dbot.db.kicks[data.kickee] + ' times)'); } }, diff --git a/modules/user.js b/modules/user.js index e9ba88a..b530332 100644 --- a/modules/user.js +++ b/modules/user.js @@ -11,7 +11,7 @@ var userCommands = function(dbot) { 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.'); + 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.'); } },