Match full user string. Fix for [#151].

This commit is contained in:
Luke Slater 2013-01-18 15:34:04 +01:00
parent dcf7d0448d
commit 6d442fd45c

View File

@ -17,7 +17,7 @@ var api = function(dbot) {
} else { } else {
// this is retarded // this is retarded
user = user.toLowerCase(); user = user.toLowerCase();
var toMatch = new RegExp(escapeRegexen(user), "i"); var toMatch = new RegExp("^" + escapeRegexen(user) + "$", "i");
var resolvedUser = _.find(knownUsers.users, function(nick) { var resolvedUser = _.find(knownUsers.users, function(nick) {
return nick.match(toMatch) !== null; return nick.match(toMatch) !== null;