mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2016
Posts: 50
T
Babel fish
OP Offline
Babel fish
T
Joined: May 2016
Posts: 50
My bot cannot see users joining the twitch chat it's connected to, though this ONLY happens when I have left mIRC running for awhile.

So basically when the bot connects to the twitch irc servers I then request the userlist by:

Code:
on *:CONNECT:{
  raw CAP REQ :twitch.tv/membership 
  raw CAP REQ :twitch.tv/commands 
  raw CAP REQ :twitch.tv/tags 
}


The first few minutes it registers users joining and leaving. But after awhile if I connect to a new Twitch chat it doesn't see users joining in that chat.

Any help would be very much appreciated, if you need further explaining in order to understand my problem, feel free to ask

Kind Regards
TillableToast


Life is potato.
Joined: Sep 2014
Posts: 52
Babel fish
Offline
Babel fish
Joined: Sep 2014
Posts: 52
If the twitch channel has over 1,000 or so users in chat, twitch will not send join/parts for the channel (except for OP's).

Last edited by paper0rplastic; 13/06/16 01:02 AM.
Joined: May 2016
Posts: 50
T
Babel fish
OP Offline
Babel fish
T
Joined: May 2016
Posts: 50
Im testing it on my own chat, which only has me and the bot in it. Though it seems like it registers when users leave, and when they join again. So if there are already users in the chat when the bot connects, it fails to grab the current users in the chat until they leave and then join again.


Life is potato.
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
This is one of the many issues with twitch's chat, and is not easily fixed from within mIRC.

To explain:
Twitch batches join/part events and removes events that cancel each other out. For example if a user leaves then rejoins, twitch does not send the PART and JOIN event with the batch of events.

Furthermore twitch's own handling, even doing it this way, is inaccurate and leads to the nicklist being wrong. I have yet to find a suitable workaround to fix it

Last edited by FroggieDaFrog; 13/06/16 12:42 PM.

I am SReject
My Stuff
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: FroggieDaFrog

Furthermore twitch's own handling, even doing it this way, is inaccurate and leads to the nicklist being wrong.


How? If it's removing canceled events it should have no effect. The only explanation would be that it's doing something other than what you are describing (like, say, outright hiding JOIN/PART events).

The issue might be related to the batching, though. If it's waiting to batch a bunch of joins, it might be waiting until after they have already spoken, leading to someone talking when they are "not in the channel"


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
The batching takes place every 20seconds and the result gets cached server-side. This leads to users joining after 19 seconds since the last batch getting an inaccurate list of users until the next batching. But the caveat here is even with the next batch of events the userlist can still be inaccurate.

This has been brought up to twitch's dev team and they've stated it has to do with maintaining states of the various client types(IRC, browser, Websockets). More to this is the web endpoint to get the current userlist will reflect exactly what mIRC has in the nicklist assuming mIRC has had enough time to receive a full set of batched events.

Twitch's dev team has stated the userlist should not be depended on. Instead, its recommended that bots use the IRCv3 msgtags sent with each message to determine a user's state(channel/stream owner, mod, sub, etc) over relying on a client's userlist. This does not take into account things that depend on an accurate userlist such as giveaways or point systems. Twitch has stated that it effects very few users in the global scope of things to be worth the time and resources to alter.

--

Here is a prime example cut straight from my buffer of how the userlist can become inaccurate. Notice that 2 minutes after I join, Twitch(jtv) removes my mode for no reason. I didn't get de-oped, disconnect or part, nor did I have a secondary client logged in under the account enter/leave the chat, etc. Then with a subsequent set of batched events it gives op status back to me.
Code:
02:35@06/14 * Attempting to rejoin channel #mirchelp
02:35@06/14 * sreject(sreject@sreject.tmi.twitch.tv) has joined.
02:35@06/14 * jtv has set mode: +o sreject
02:37@06/14 * jtv has set mode: -o sreject
02:38@06/14 * jtv has set mode: +o sreject


This also happens with join and part events, apparently for no reason. Furthermore, the inaccuracy can span multiple batch sets before its rectified if it does at all. My bot in the channel hasn't been in the nicklist(due to a part event) for, what I can tell, 6hrs even though it has been connected and in the room the entire time.


Last edited by FroggieDaFrog; 14/06/16 10:00 PM.

I am SReject
My Stuff

Link Copied to Clipboard