Issuing commands like "/clear" cause code to crash
Closed this issue · 4 comments
TheIcemanCometh commented
If you issue a command in chat such as /clear
, the function formatCLEARCHAT(event)
will crash, when it tries to parse out the username and there isn't one.
Possible fix
if (target_username)
parsed.target_username = target_username.replace(/\r\n/g, '')
Sample data
Event: @room-id=#######;tmi-sent-ts=1516271888978 :tmi.twitch.tv CLEARCHAT #channelname
kritzware commented
Thanks for finding this 👍
I'll take a look into it and fix this issue, unless you'd rather do a pull request?
TheIcemanCometh commented
I can do a pull request, but it won't be for a couple of hours at least. I'm getting ready to head to work.
kritzware commented
No worries, take your time, and thanks for contributing! 😄
bbakersc commented
I tried to create the pull request, but the request gave me a 403 error.