From 6d442fd45c0d60add4f6163b1944eef228fe3f58 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Fri, 18 Jan 2013 15:34:04 +0100 Subject: [PATCH] Match full user string. Fix for [#151]. --- modules/users/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/users/api.js b/modules/users/api.js index 4d14a7c..c36e21e 100644 --- a/modules/users/api.js +++ b/modules/users/api.js @@ -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;