From 60b40bd3941fedd55aff06ba378d52293902eb73 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Mon, 13 Apr 2015 21:59:56 -0400 Subject: [PATCH] Slightly better chat tracking (multi-user) --- bot.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot.js b/bot.js index a00c9b0..a421287 100644 --- a/bot.js +++ b/bot.js @@ -1,3 +1,4 @@ +var botUsers = ['atomaka','greggnic']; var botLoop; var botGlobalBossTimer; var botPaused = true; @@ -135,7 +136,8 @@ function chatIsPM(message) { } function chatHasName(message) { - return /atomaka/.exec(message.find('.message').text()) != null; + var string = message.find('.message').text(); + return (new RegExp( '\\b' + botUsers.join('\\b|\\b') + '\\b')).test(string) === true; } function botTimestamp() {