Closed YetAnotherSimon closed 2 years ago
Hello! Thanks for the issue. If this is a general help question, for a faster response consider joining the official Discord Server
Else if you have an issue with the library please wait for someone to help you here.
Well with this example your bot would stop running within 30 seconds, because you need to connect to a channel for twitch to keep your connection alive. However if you don't provide initial channels, no channels are sent at startup, which means twitch will not provide a ready event; thus no event_ready
Oh okay I see, then I will add a default channel. Maybe this is something to note down in the documentation? This seems like an rather important information to me for something marked as optional
Hello, sorry for the slow response. A note in the docs is a good idea. This event is dispatched whenever it is received by twitch. Calling client.join_channels after starting the bot should in theory still dispatch this event, however using initial_channels is still recommended
Oh, so that's the reason... I was wondering why nothing happened after twitch sends me codes 1, 2, 3, 4, 375, 372, 376. I guess the behavior changed after https://github.com/TwitchIO/TwitchIO/commit/49ba6a53b830458c778a392bddb82b9a3e8ff9e4#diff-c98e8aab9611c0fdcab32d3a2e428de2db41bb097987af0aef88b5cba753c163 so I didn't experience this issue while using 2.1.5, but am now after updating to 2.3.0... Any reason this was changed to enforcing initial_channels? Basically breaking whisper-listening bots...
You can add the bots own channel to initial_channels for now, it should only be event_ready that doesn't fire with empty channels, but it could still send and recieve data. I'll look into making empty lists trigger it again soon. The main reason the channel codes were explicitly added was the introduction of wait_for_ready.
Can we let the 376 RPL_ENDOFMOTD ":End of MOTD command"
code trigger is_ready
?
It seems to be the last reply twitch sends in the initial burst after connecting 🤔
The problem is that event_ready
is supposed to represent the bots internal cache being fullfilled as well as being authenticated by Twitch. So currently it's slightly flawed, I'm not entirely sure how it will be fixed in 2.0 I might leave that up to @chillymosh but in 3.0 the behaviour will be different.
I've added the 3.x label here as this will need to be changed on that version as well.
@Commaster please try with the latest push
@Commaster please try with the latest push
@chillymosh I'm using pip so I just patched my local websocket.py
with your changes (Hope this is okay). I'm getting event_ready
properly now. Thank you!
Fixed in 1559d1a2a56b2a04b140a5e37a88767371761082
Hello there, I stumbled across the issue that my event ready function is not called if the initial_channels parameter is not passed to the client. Since it is an optional parameter, I don't think this is supposed to happen.
Thanks in advance!