3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-01 00:19:29 +01:00
dbot/modules/kick.js

45 lines
1.4 KiB
JavaScript
Raw Normal View History

2011-08-22 20:24:23 +02:00
var kick = function(dbot) {
2011-08-22 22:46:43 +02:00
var dbot = dbot;
2011-08-22 20:24:23 +02:00
return {
'listener': function(data) {
if(data.kickee == dbot.name) {
2011-10-12 18:40:21 +02:00
dbot.instance.join(data.channel);
2011-08-22 20:24:23 +02:00
dbot.say(data.channel, 'Thou shalt not kick ' + dbot.name);
dbot.db.kicks[dbot.name] += 1;
2011-08-22 20:24:23 +02:00
} else {
2011-11-01 17:26:16 +01:00
if(dbot.db.modehate.include(data.user)) {
dbot.instance.send('KICK ' + data.channel + ' ' + data.user + ' :gtfo (MODEHATE)');
if(!dbot.db.kicks.hasOwnProperty(data.user)) {
dbot.db.kicks[data.user] = 1;
} else {
dbot.db.kicks[data.user] += 1;
}
}
if(!dbot.db.kicks.hasOwnProperty(data.kickee)) {
2011-08-22 20:24:23 +02:00
dbot.db.kicks[data.kickee] = 1;
} else {
dbot.db.kicks[data.kickee] += 1;
}
2011-10-12 18:40:21 +02:00
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)');
2011-08-22 20:24:23 +02:00
}
},
on: 'KICK'
};
};
exports.fetch = function(dbot) {
return kick(dbot);
};