kritzware / twitch-bot

🤖 Easily create chat bots for Twitch.tv
https://www.npmjs.com/package/twitch-bot
MIT License
149 stars 36 forks source link

batch events #27

Closed nordox closed 6 years ago

nordox commented 6 years ago

I've noticed batch joins will cause the bot to incorrectly parse and attempt to join a nonexistent channel.

Example: Let the data be

":user1!user1@user1.tmi.twitch.tv JOIN #channel :user2!user2@user2.tmi.twitch.tv JOIN #channel :jtv MODE #channel +o user1"

Bot will then parse and join "#channel:user2!user2@user2.tmi.twitch.tv "


How are JOIN/PART events supposed to be handled? Do we only care about our own events? If so, should we also listen for username?

kritzware commented 6 years ago

Hi @nordox - Thanks for reporting this. This was an issue with the way we parse irc JOIN events, and now it should work as expected, also see #26 (update the bot to 1.2.4 on npm).

Currently we don't support user join events (such as a user joining the channel) and just listen for the bot events (the bot itself joining/parting the channel).

You're definitely correct that we should also listen for the username, and that is what I've done in the fix.

Thanks! 👍