mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 14:29:29 +01:00
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
|
||||
user = user.toLowerCase();
|
||||
var resolvedUser = _.find(knownUsers.users, function(nick) {
|
||||
var toMatch = new RegExp("/"+user+"/i").compile();
|
||||
return nick.match(toMatch);
|
||||
var toMatch = new RegExp(user, "i");
|
||||
return nick.match(toMatch) !== null;
|
||||
}, this);
|
||||
|
||||
if(!resolvedUser) {
|
||||
resolvedUser = _.find(knownUsers.aliases, function(nick, alias) {
|
||||
var toMatch = new RegExp("/"+user+"/i").compile();
|
||||
return alias.match(toMatch);
|
||||
var toMatch = new RegExp(user, "i");
|
||||
return alias.match(toMatch) !== null;
|
||||
}, this);
|
||||
user = knownUsers.aliases[resolvedUser];
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user