3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-23 20:39:25 +01:00
This commit is contained in:
Luke Slater 2011-10-12 17:40:21 +01:00
parent 6528eace6e
commit 04dc901974
2 changed files with 9 additions and 2 deletions

View File

@ -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)');
}
},

View File

@ -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.');
}
},