tmijs / tmi.js

💬 Javascript library for the Twitch Messaging Interface. (Twitch.tv)
https://tmijs.com
MIT License
1.54k stars 216 forks source link

High number of random 'part' and 'join' events being triggered #451

Closed davidreis97 closed 3 years ago

davidreis97 commented 3 years ago

Actual behaviour:

After joining and processing messages coming from multiple channels for a while, occasionally there are dozens of events quickly fired for seemingly no reason.

In the screenshot below you can see this behaviour happening. At this point in the execution, the program wasn't joining or parting from channels, it was just processing incoming messages from channels previously joined.

image

Expected behaviour:

After joining a channel a 'join' event should be triggered once and when leaving a channel a 'part' event should be triggered once. No other 'join' or 'part' events should be triggered.

Server configuration

AlcaDesign commented 3 years ago

There are 2 additional arguments to the join and part event. Twitch sends join and part data for other users. Use theself argument to tell when the client user has joined or parted channel.

client.on('join', (channel, username, self) => {});