mirror of
https://github.com/reality/dbot.git
synced 2024-12-25 04:02:39 +01:00
channels in function loop
This commit is contained in:
parent
50801f7afb
commit
bff59d3424
@ -47,13 +47,18 @@ var commands = function(dbot) {
|
|||||||
reason = event.input[2],
|
reason = event.input[2],
|
||||||
channels = dbot.config.servers[server].channels;
|
channels = dbot.config.servers[server].channels;
|
||||||
|
|
||||||
_.each(channels, function(channel) {
|
var i = 0;
|
||||||
setTimeout(function(channel) {
|
var banChannel = function(channels) {
|
||||||
this.api.ban(server, banee, channel);
|
if(i >= channels.length) return;
|
||||||
this.api.kick(server, banee, channel, reason +
|
var channel = channels[i];
|
||||||
' (network-wide ban requested by ' + banner + ')');
|
this.api.ban(server, banee, channel);
|
||||||
}.bind(this), 1000);
|
this.api.kick(server, banee, channel, reason +
|
||||||
}, this);
|
' (network-wide ban requested by ' + banner + ')');
|
||||||
|
setTimeout(function(channels) {
|
||||||
|
i++; banChannel(channels);
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
banChannel(channels);
|
||||||
|
|
||||||
var notifyString = dbot.t('nbanned', {
|
var notifyString = dbot.t('nbanned', {
|
||||||
'banner': banner,
|
'banner': banner,
|
||||||
|
Loading…
Reference in New Issue
Block a user