mirror of
https://github.com/reality/dbot.git
synced 2024-11-24 04:49:25 +01:00
fixed up kick [#131]
This commit is contained in:
parent
1d5fcf2f40
commit
7a6cab841e
@ -50,40 +50,38 @@ var kick = function(dbot) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
this.name = 'kick';
|
||||||
'name': 'kick',
|
this.ignorable = false;
|
||||||
'ignorable': false,
|
this.commands = commands;
|
||||||
'commands': commands,
|
|
||||||
|
|
||||||
'listener': function(event) {
|
this.listener = function(event) {
|
||||||
if(event.kickee == dbot.config.name) {
|
if(event.kickee == dbot.config.name) {
|
||||||
dbot.instance.join(event, event.channel);
|
dbot.instance.join(event, event.channel);
|
||||||
event.reply(dbot.t('kicked_dbot', { 'botname': dbot.config.name }));
|
event.reply(dbot.t('kicked_dbot', { 'botname': dbot.config.name }));
|
||||||
dbot.db.kicks[dbot.config.name] += 1;
|
dbot.db.kicks[dbot.config.name] += 1;
|
||||||
|
} else {
|
||||||
|
if(!_.has(dbot.db.kicks, event.kickee)) {
|
||||||
|
dbot.db.kicks[event.kickee] = 1;
|
||||||
} else {
|
} else {
|
||||||
if(!_.has(dbot.db.kicks, event.kickee)) {
|
dbot.db.kicks[event.kickee] += 1;
|
||||||
dbot.db.kicks[event.kickee] = 1;
|
|
||||||
} else {
|
|
||||||
dbot.db.kicks[event.kickee] += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!_.has(dbot.db.kickers, event.user)) {
|
|
||||||
dbot.db.kickers[event.user] = 1;
|
|
||||||
} else {
|
|
||||||
dbot.db.kickers[event.user] += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
event.reply(event.kickee + '-- (' + dbot.t('user_kicks', {
|
|
||||||
'user': event.kickee,
|
|
||||||
'kicks': dbot.db.kicks[event.kickee],
|
|
||||||
'kicked': dbot.db.kickers[event.kickee]
|
|
||||||
}) + ')');
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
on: 'KICK'
|
if(!_.has(dbot.db.kickers, event.user)) {
|
||||||
|
dbot.db.kickers[event.user] = 1;
|
||||||
|
} else {
|
||||||
|
dbot.db.kickers[event.user] += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.reply(event.kickee + '-- (' + dbot.t('user_kicks', {
|
||||||
|
'user': event.kickee,
|
||||||
|
'kicks': dbot.db.kicks[event.kickee],
|
||||||
|
'kicked': dbot.db.kickers[event.kickee]
|
||||||
|
}) + ')');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
this.on = 'KICK';
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.fetch = function(dbot) {
|
exports.fetch = function(dbot) {
|
||||||
return kick(dbot);
|
return new kick(dbot);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user