From eb348848e6d4dde4a639ea6e3218f30d04a05130 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 29 Nov 2013 06:16:33 +0000 Subject: [PATCH] this commit either a) Closes #598 or b) kills us all. Hold onto your coconuts. --- modules/kick/commands.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/kick/commands.js b/modules/kick/commands.js index f50fa58..91c607c 100644 --- a/modules/kick/commands.js +++ b/modules/kick/commands.js @@ -83,6 +83,11 @@ var commands = function(dbot) { channel = event.input[1], reason = event.input[3]; + if(_.isUndefined(channel)) { + channel = event.channel.name; + } + channel = channel.trim(); + this.api.kick(server, kickee, channel, reason + ' (requested by ' + kicker + ')'); dbot.api.report.notify('kick', server, event.rUser, channel, dbot.t('ckicked', { @@ -272,7 +277,7 @@ var commands = function(dbot) { commands['~quiet'].access = 'voice'; commands['~unquiet'].access = 'voice'; - commands['~ckick'].regex = [/^~ckick ([^ ]+) ([^ ]+) (.+)$/, 4]; + commands['~ckick'].regex = /^~ckick (#[^ ]+ )?([^ ]+) ?(.*)?$/; commands['~nban'].regex = /^~nban ([\d\.^ ]+)?([^ ]+) (.+)$/; commands['~quiet'].regex = /^~quiet ([\d\.^ ]+)?(#[^ ]+ )?([^ ]+) ?(.*)?$/; commands['~unquiet'].regex = /^~unquiet (#[^ ]+ )?([^ ]+) ?$/;