Created
February 13, 2016 23:52
-
-
Save jonasbits/c82793c80fabadad0e43 to your computer and use it in GitHub Desktop.
stalk words for cIRC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NickMentionedNotification.shouldNotify = function(nick, msg) { | |
var msgToTest; | |
if (!(nick != null)) { | |
return false; | |
} | |
nick = nick.replace(/_+$/, ''); | |
nick = this._escapeTextForRegex(nick); | |
msgToTest = this._prepMessageForRegex(msg, nick); | |
if ( /bitcoin_*([!?.]*|[-:;~\*\u0001]?)(?!\S)/i.test(msgToTest) ) { | |
return true; | |
} | |
return /\#nick\#_*([!?.]*|[-:;~\*\u0001]?)(?!\S)/i.test(msgToTest); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment