This commit is contained in:
reality 2013-04-14 13:58:45 +00:00
parent de2a22834d
commit 5e0f126693

View File

@ -53,10 +53,18 @@ var api = function(dbot) {
var applies = false; var applies = false;
if(_.has(dbot.commands[commandName], 'regex')) { if(_.has(dbot.commands[commandName], 'regex')) {
var cRegex = dbot.commands[commandName].regex; var cRegex = dbot.commands[commandName].regex;
var q = event.message.valMatch(cRegex[0], cRegex[1]); if(_.isArray(cRegex) && cRegex.length == 2) {
if(q) { var q = event.message.valMatch(cRegex[0], cRegex[1]);
applies = true; if(q) {
event.input = q; applies = true;
event.input = q;
}
} else if {
var q = event.message.match(cRegex);
if(q) {
applies = true;
event.input = q;
]
} }
} else { } else {
applies = true; applies = true;