forked from GitHub/dbot
~nban no longer bans from network admin channel, posts notification in network admin chan
This commit is contained in:
parent
cd4b9460b1
commit
0421316002
@ -45,21 +45,9 @@ var commands = function(dbot) {
|
|||||||
banner = event.user,
|
banner = event.user,
|
||||||
banee = event.input[1],
|
banee = event.input[1],
|
||||||
reason = event.input[2],
|
reason = event.input[2],
|
||||||
|
adminChannel = this.config.admin_channels[event.server];
|
||||||
channels = dbot.config.servers[server].channels;
|
channels = dbot.config.servers[server].channels;
|
||||||
|
|
||||||
var i = 0;
|
|
||||||
var banChannel = function(channels) {
|
|
||||||
if(i >= channels.length) return;
|
|
||||||
var channel = channels[i];
|
|
||||||
this.api.ban(server, banee, channel);
|
|
||||||
this.api.kick(server, banee, channel, reason +
|
|
||||||
' (network-wide ban requested by ' + banner + ')');
|
|
||||||
setTimeout(function() {
|
|
||||||
i++; banChannel(channels);
|
|
||||||
}, 1000);
|
|
||||||
}.bind(this);
|
|
||||||
banChannel(channels);
|
|
||||||
|
|
||||||
var notifyString = dbot.t('nbanned', {
|
var notifyString = dbot.t('nbanned', {
|
||||||
'banner': banner,
|
'banner': banner,
|
||||||
'banee': banee,
|
'banee': banee,
|
||||||
@ -79,11 +67,27 @@ var commands = function(dbot) {
|
|||||||
notifyString += ' ' + dbot.t('quote_recorded', { 'user': banee });
|
notifyString += ' ' + dbot.t('quote_recorded', { 'user': banee });
|
||||||
}
|
}
|
||||||
|
|
||||||
var notifyChannel = event.channel.name;
|
// Notify moderators, banee
|
||||||
if(this.config.admin_channels[event.server]) {
|
if(this.config.admin_channels[event.server]) {
|
||||||
notifyChannel = this.config.admin_channels[event.server];
|
notifyChannel = this.config.admin_channels[event.server];
|
||||||
|
channels = _.without(channels, notifyChannel);
|
||||||
|
dbot.api.report.notify(server, adminChannel, notifyString);
|
||||||
|
dbot.say(event.server, adminChannel, notifyString);
|
||||||
}
|
}
|
||||||
dbot.api.report.notify(server, notifyChannel, notifyString);
|
|
||||||
|
// Ban the user from all channels
|
||||||
|
var i = 0;
|
||||||
|
var banChannel = function(channels) {
|
||||||
|
if(i >= channels.length) return;
|
||||||
|
var channel = channels[i];
|
||||||
|
this.api.ban(server, banee, channel);
|
||||||
|
this.api.kick(server, banee, channel, reason +
|
||||||
|
' (network-wide ban requested by ' + banner + ')');
|
||||||
|
setTimeout(function() {
|
||||||
|
i++; banChannel(channels);
|
||||||
|
}, 1000);
|
||||||
|
}.bind(this);
|
||||||
|
banChannel(channels);
|
||||||
},
|
},
|
||||||
|
|
||||||
/*** Kick Stats ***/
|
/*** Kick Stats ***/
|
||||||
|
Loading…
Reference in New Issue
Block a user