From 5cf57146408d11a116cbe057bb1bd7ad4faec716 Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 1 Jul 2013 17:33:19 +0000 Subject: [PATCH] fix regex & trim --- modules/kick/commands.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/kick/commands.js b/modules/kick/commands.js index 7486a90..5ee7da7 100644 --- a/modules/kick/commands.js +++ b/modules/kick/commands.js @@ -8,11 +8,12 @@ var commands = function(dbot) { var server = event.server, quieter = event.user, channel = event.input[1], - quietee = event.input[2]; + quietee = event.input[2].trim(); if(_.isUndefined(channel)) { channel = event.channel.name; } + channel = channel.trim(); this.api.quiet(server, quietee, channel); event.reply(dbot.t('quieted', { 'quietee': quietee })); @@ -238,7 +239,7 @@ var commands = function(dbot) { commands['~ckick'].regex = [/^~ckick ([^ ]+) ([^ ]+) (.+)$/, 4]; commands['~nban'].regex = /^~nban ([\d\.^ ]+)?([^ ]+) (.+)$/; - commands['~quiet'].regex = /^~quiet (#[^ ]+ )?([^ ]+)$/; + commands['~quiet'].regex = /^~quiet (#[^ ]+ )?([^ ]+) ?$/; return commands; };