Coder Social home page Coder Social logo

Comments (10)

Teekeks avatar Teekeks commented on June 10, 2024

The rate limit warnings can be ignored since they are just informing you that you are waiting for the bucket to be opened again (this is unavoidable when trying to join a lot of channels quickly).

They should probably not be a warning though but something like info or debug.

from pytwitchapi.

Pidgeot avatar Pidgeot commented on June 10, 2024

Sure... but again, I'm only trying to join one channel, and it's right at startup. There's no dynamic joining or anything.

So how does the bucket get filled up in the first place? And why would it list the same channel multiple times in one output line?

from pytwitchapi.

Teekeks avatar Teekeks commented on June 10, 2024

oh, now I get the problem. yes thats indeed not intended behaviour :D

from pytwitchapi.

Teekeks avatar Teekeks commented on June 10, 2024

Can you try to set the logging level to debug and then look out for any messages that read like got NOTICE for channel [...]?

from pytwitchapi.

Pidgeot avatar Pidgeot commented on June 10, 2024

I'm still waiting to see the exact issue again, but I did notice this in what I've been logging so far:

DEBUG:twitchAPI.chat:websocket is closing
DEBUG:twitchAPI.chat:reconnecting...
DEBUG:twitchAPI.chat:> "CAP REQ :twitch.tv/membership twitch.tv/tags twitch.tv/commands"
DEBUG:twitchAPI.chat:> "PASS oauth:<redacted>"
DEBUG:twitchAPI.chat:> "NICK <redacted>"
DEBUG:twitchAPI.chat:< :tmi.twitch.tv CAP * ACK :twitch.tv/membership twitch.tv/tags twitch.tv/commands
DEBUG:twitchAPI.chat:got CAP reply, granted caps: twitch.tv/membership twitch.tv/tags twitch.tv/commands
DEBUG:twitchAPI.chat:< :tmi.twitch.tv 001 <redacted> :Welcome, GLHF!
DEBUG:twitchAPI.chat:< :tmi.twitch.tv 002 <redacted> :Your host is tmi.twitch.tv
DEBUG:twitchAPI.chat:numeric message: 002
002 <redacted>
DEBUG:twitchAPI.chat:< :tmi.twitch.tv 003 <redacted> :This server is rather new
DEBUG:twitchAPI.chat:numeric message: 003
003 <redacted>
DEBUG:twitchAPI.chat:< :tmi.twitch.tv 004 <redacted> :-
DEBUG:twitchAPI.chat:numeric message: 004
004 <redacted>
DEBUG:twitchAPI.chat:< :tmi.twitch.tv 375 <redacted> :-
DEBUG:twitchAPI.chat:numeric message: 375
375 <redacted>
DEBUG:twitchAPI.chat:< :tmi.twitch.tv 372 <redacted> :You are in a maze of twisty passages, all alike.
DEBUG:twitchAPI.chat:numeric message: 372
372 <redacted>
DEBUG:twitchAPI.chat:< :tmi.twitch.tv 376 <redacted> :>
DEBUG:twitchAPI.chat:numeric message: 376
376 <redacted>
DEBUG:twitchAPI.chat:< @badge-info=;badges=;color=;display-name=<redacted>;emote-sets=0,300374282;user-id=945399114;user-type= :tmi.twitch.tv GLOBALUSERSTATE
DEBUG:twitchAPI.chat:got ready event
DEBUG:twitchAPI.chat:> "JOIN #mioschannel,#mioschannel"
DEBUG:twitchAPI.chat:< :<redacted>!<redacted>@<redacted>.tmi.twitch.tv JOIN #mioschannel
DEBUG:twitchAPI.chat:< :<redacted>.tmi.twitch.tv 353 <redacted> = #mioschannel :<redacted>
DEBUG:twitchAPI.chat:< :<redacted>.tmi.twitch.tv 366 <redacted> #mioschannel :End of /NAMES list
DEBUG:twitchAPI.chat:numeric message: 366
366 <redacted> #mioschannel
DEBUG:twitchAPI.chat:< @badge-info=;badges=vip/1;color=;display-name=<redacted>;emote-sets=0,300374282;mod=0;subscriber=0;user-type= :tmi.twitch.tv USERSTATE #mioschannel
DEBUG:twitchAPI.chat:< @emote-only=1;followers-only=-1;r9k=0;room-id=769035392;slow=0;subs-only=0 :tmi.twitch.tv ROOMSTATE #mioschannel
DEBUG:twitchAPI.chat:got user state event
DEBUG:twitchAPI.chat:got room state event
DEBUG:twitchAPI.chat:< :<redacted>!<redacted>@<redacted>.tmi.twitch.tv JOIN #mioschannel
DEBUG:twitchAPI.chat:< @badge-info=;badges=vip/1;color=;display-name=<redacted>;emote-sets=0,300374282;mod=0;subscriber=0;user-type= :tmi.twitch.tv USERSTATE #mioschannel
DEBUG:twitchAPI.chat:< @emote-only=1;followers-only=-1;r9k=0;room-id=769035392;slow=0;subs-only=0 :tmi.twitch.tv ROOMSTATE #mioschannel
DEBUG:twitchAPI.chat:got user state event
DEBUG:twitchAPI.chat:got room state event
DEBUG:twitchAPI.chat:< :<redacted>.tmi.twitch.tv 353 <redacted> = #mioschannel :<redacted>
DEBUG:twitchAPI.chat:< :<redacted>.tmi.twitch.tv 366 <redacted> #mioschannel :End of /NAMES list
DEBUG:twitchAPI.chat:numeric message: 366
366 <redacted> #mioschannel
INFO:twitchAPI.chat:done joining initial channels

Something about losing the websocket connection seems to make it duplicate the channel list... and this only starts happening after the second disconnect. There was what looked like a third disconnect later, and now the channel was listed four times in the JOIN command.

As to why it keeps disconnecting... I don't know, but I've noticed that in my browser too if there's no activity. So it's probably an issue with my ISP or router (even though the ping/pong process occurs...), but it's not something I think I can easily fix on my end.

Oh, and in case it wasn't clear: there were no messages like the one you mentioned. It seems to be entirely down to the connection loss.

from pytwitchapi.

Teekeks avatar Teekeks commented on June 10, 2024

using initial_channel (see here: https://pytwitchapi.readthedocs.io/en/stable/modules/twitchAPI.chat.html#twitchAPI.chat.Chat.__init__ ) instead of joining in on_ready would probably fix that for now btu this is def a bug in the logic.

from pytwitchapi.

Pidgeot avatar Pidgeot commented on June 10, 2024

I removed on_ready entirely and changed the chat initialization to chat = await Chat(twitch, initial_channel=[CHANNEL]).

If anything, it seems to have made it worse, because now the list was doubled on the first reconnect. Logs are otherwise identical to the above.

from pytwitchapi.

Teekeks avatar Teekeks commented on June 10, 2024

Good catch, the commit above should fix this behavior

from pytwitchapi.

Pidgeot avatar Pidgeot commented on June 10, 2024

Seems to work well! I think you might also need to lowercase initial_list in Chat.init, because there was a duplicate after a reconnect when I used the mixed case name instead - but only the one, and it didn't grow beyond that. So it's pretty easy to workaround for the caller anyway.

Using the on_ready method works fine even with mixed case, so sticking to that is also an option.

from pytwitchapi.

Teekeks avatar Teekeks commented on June 10, 2024

added in 412caca

from pytwitchapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.