3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00

fix regex glober

This commit is contained in:
reality 2013-12-29 18:47:31 +00:00
parent a554b8d1cf
commit a4009d7ff3
2 changed files with 2 additions and 5 deletions

View File

@ -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;

View File

@ -53,10 +53,6 @@ var command = function(dbot) {
}
});
return;
}
else if(_.has(dbot.modules, 'quotes')) {
commandName = this.config.commandPrefix;
} else {
return;
}