kritzware/twitch-bot

Issuing commands like "/clear" cause code to crash

Closed this issue · 4 comments

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

Thanks for finding this 👍

I'll take a look into it and fix this issue, unless you'd rather do a pull request?

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.

No worries, take your time, and thanks for contributing! 😄

I tried to create the pull request, but the request gave me a 403 error.