Subscriber Alerts

The last character of any IRC message is a line break, or the equivalent of \r\n. Easier than to always compare to that character would be to simply strip the last character and compare to the remainder.

I understand that this is a work in progress, but I suggest you build a more robust tokenizer. You could use splitting, as in Twisted or simple iteration. The tmi protocol is detailed in IRC.md. If you prefer a brebuilt library there are many for IRC and tmi.js for Twitch specifically.