mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 22:39:26 +01:00
wat
This commit is contained in:
parent
157fe71fc1
commit
a433b592c9
@ -14,13 +14,13 @@ 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");
|
var toMatch = new RegExp(_.escape(user), "i");
|
||||||
return nick.match(toMatch) !== null;
|
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");
|
var toMatch = new RegExp(_.escape(user), "i");
|
||||||
return alias.match(toMatch) !== null;
|
return alias.match(toMatch) !== null;
|
||||||
}, this);
|
}, this);
|
||||||
user = knownUsers.aliases[resolvedUser];
|
user = knownUsers.aliases[resolvedUser];
|
||||||
|
Loading…
Reference in New Issue
Block a user