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 {
// this is retarded
user = user.toLowerCase();
var toMatch = new RegExp(escapeRegexen(user), "i");
var toMatch = new RegExp("^" + escapeRegexen(user) + "$", "i");
var resolvedUser = _.find(knownUsers.users, function(nick) {
return nick.match(toMatch) !== null;