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

Channel joining/parting does not work properly #23

Closed Hammster closed 6 years ago

Hammster commented 6 years ago

Hi there,

I found a interesting issue in the latest feature:

I'm not 100% sure if this error originates from my code, you can check it out on GitHub though Hammster/twitch-chat#1

Btw this is for a Visual Studio Code extension that is using your library ;)

kritzware commented 6 years ago

Thanks for reporting this. That extension looks really cool, nice one! 👍

PBug90 commented 6 years ago

Could be an issue with the membership capability and the JOIN/PART for the bot user conflicting with JOIN/PART-messages, since the condition is the existence of a 'JOIN' in the string received from server, which is the case for both the generic and membership capabilities:

https://github.com/kritzware/twitch-bot/blob/master/lib/bot.js#L90

A quick and dirty workaround to test if thats really the root of the problem is commenting out the following line: https://github.com/kritzware/twitch-bot/blob/master/lib/bot.js#L57

https://dev.twitch.tv/docs/irc#irc-generic-capabilities https://dev.twitch.tv/docs/irc#twitch-irc-capability-membership

PBug90 commented 6 years ago

Nevermind, its about parsing the join/part-events. I implemented the parser for that and it doesnt take into account that there can be \r\n at the end of the message.

Will fix and submit PR.

PBug90 commented 6 years ago

https://github.com/kritzware/twitch-bot/pull/25

kritzware commented 6 years ago

This issue should be resolved now @Hammster! Make sure to upgrade the package from npm to the newest releast (1.2.3) 👍