From a4009d7ff3787b8475d12bd3f3059a421c2f013d Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 29 Dec 2013 18:47:31 +0000 Subject: [PATCH] fix regex glober --- modules/command/api.js | 3 ++- modules/command/command.js | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/command/api.js b/modules/command/api.js index 768c720..2e6ac63 100644 --- a/modules/command/api.js +++ b/modules/command/api.js @@ -54,9 +54,10 @@ var api = function(dbot) { */ 'applyRegex': function(commandName, event) { var applies = false; + event.message = event.message.substring(1); if(_.has(dbot.commands[commandName], 'regex')) { var cRegex = dbot.commands[commandName].regex; - if(_.isArray(cRegex) && cRegex.length == 2) { + if(_.isArray(cRegex) && cRegex.length === 2) { var q = event.message.valMatch(cRegex[0], cRegex[1]); if(q) { applies = true; diff --git a/modules/command/command.js b/modules/command/command.js index 3fc51b9..1c7878b 100644 --- a/modules/command/command.js +++ b/modules/command/command.js @@ -53,10 +53,6 @@ var command = function(dbot) { } }); return; - } - - else if(_.has(dbot.modules, 'quotes')) { - commandName = this.config.commandPrefix; } else { return; }