From 5e0f1266933aa938fe55db5281a9d9fa35ff88f2 Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 14 Apr 2013 13:58:45 +0000 Subject: [PATCH] Do [#359] --- modules/command/api.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/command/api.js b/modules/command/api.js index dd19b9e..3f3ae3d 100644 --- a/modules/command/api.js +++ b/modules/command/api.js @@ -53,10 +53,18 @@ var api = function(dbot) { var applies = false; if(_.has(dbot.commands[commandName], 'regex')) { var cRegex = dbot.commands[commandName].regex; - var q = event.message.valMatch(cRegex[0], cRegex[1]); - if(q) { - applies = true; - event.input = q; + if(_.isArray(cRegex) && cRegex.length == 2) { + var q = event.message.valMatch(cRegex[0], cRegex[1]); + if(q) { + applies = true; + event.input = q; + } + } else if { + var q = event.message.match(cRegex); + if(q) { + applies = true; + event.input = q; + ] } } else { applies = true;