forked from GitHub/dbot
exempt
This commit is contained in:
parent
d7f212ea52
commit
510a02d08a
@ -32,7 +32,7 @@ var kick = function(dbot) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
'kill': function(server, user, reason) {
|
'kill': function(server, user, reason) {
|
||||||
dbot.instance.connections[server].send('kill ' + user + ' :' + reason);
|
dbot.instance.connections[server].send('kill ' + user + ' ' + reason);
|
||||||
},
|
},
|
||||||
|
|
||||||
'unban': function(server, host, channel) {
|
'unban': function(server, host, channel) {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
"action": "kill",
|
"action": "kill",
|
||||||
"sensitivity": 10
|
"sensitivity": 10,
|
||||||
|
"exempt": []
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ var _ = require('underscore')._;
|
|||||||
var kill_namespam = function(dbot) {
|
var kill_namespam = function(dbot) {
|
||||||
this.listener = function(event) {
|
this.listener = function(event) {
|
||||||
if(event.channel == event.user) return; // return if pm
|
if(event.channel == event.user) return; // return if pm
|
||||||
|
if(_.includes(this.config.exempt, event.user)) return;
|
||||||
if(_.filter(event.message.split(' '), function(word) { return _.has(event.channel.nicks, word); }).length > this.config.sensitivity) {
|
if(_.filter(event.message.split(' '), function(word) { return _.has(event.channel.nicks, word); }).length > this.config.sensitivity) {
|
||||||
var message = dbot.t('namespam_act', {
|
var message = dbot.t('namespam_act', {
|
||||||
'user': event.user,
|
'user': event.user,
|
||||||
|
Loading…
Reference in New Issue
Block a user