forked from GitHub/dbot
and they told me no bru regex is cool u wil hav fun
This commit is contained in:
parent
12db5c64e9
commit
76382a6daa
@ -14,14 +14,14 @@ var api = function(dbot) {
|
|||||||
// this is retarded
|
// this is retarded
|
||||||
user = user.toLowerCase();
|
user = user.toLowerCase();
|
||||||
var resolvedUser = _.find(knownUsers.users, function(nick) {
|
var resolvedUser = _.find(knownUsers.users, function(nick) {
|
||||||
var toMatch = new RegExp("/"+user+"/i").compile();
|
var toMatch = new RegExp(user, "i");
|
||||||
return nick.match(toMatch);
|
return nick.match(toMatch) !== null;
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
if(!resolvedUser) {
|
if(!resolvedUser) {
|
||||||
resolvedUser = _.find(knownUsers.aliases, function(nick, alias) {
|
resolvedUser = _.find(knownUsers.aliases, function(nick, alias) {
|
||||||
var toMatch = new RegExp("/"+user+"/i").compile();
|
var toMatch = new RegExp(user, "i");
|
||||||
return alias.match(toMatch);
|
return alias.match(toMatch) !== null;
|
||||||
}, this);
|
}, this);
|
||||||
user = knownUsers.aliases[resolvedUser];
|
user = knownUsers.aliases[resolvedUser];
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user