From a378ec7ab4c33d81442de58bd83c5512bb38d9cf Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 27 Oct 2015 19:33:08 +0000 Subject: [PATCH] oops --- modules/kick/commands.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/modules/kick/commands.js b/modules/kick/commands.js index 7c9fa87..3a0ae7f 100644 --- a/modules/kick/commands.js +++ b/modules/kick/commands.js @@ -139,6 +139,19 @@ var commands = function(dbot) { network = this.config.network_name[event.server]; } + // 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, host, channel); + this.api.kick(server, banee, channel, reason + + ' (network-wide ban requested by ' + banner + ')'); + setTimeout(function() { + i++; banChannel(channels); + }, 1000); + }.bind(this); + banChannel(channels); dbot.api.nickserv.getUserHost(event.server, banee, function(host) { // Add host record entry @@ -221,21 +234,6 @@ var commands = function(dbot) { // err dbot.say(event.server, 'NickServ', 'FREEZE ' + banee + ' ON ' + reason); - - // 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, host, channel); - this.api.kick(server, banee, channel, reason + - ' (network-wide ban requested by ' + banner + ')'); - setTimeout(function() { - i++; banChannel(channels); - }, 1000); - }.bind(this); - banChannel(channels); } else { event.reply(dbot.t('no_user', { 'user': banee })); }