dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
680 stars 161 forks source link

on_ready event #378

Closed githubdontbanmeagain closed 1 year ago

githubdontbanmeagain commented 1 year ago

Summary

on_ready event getting called after bot has already been connected

Reproduction Steps

Reported from many users, depending on the account "size" (servers, friends, dms) on_ready takes longer to appear, from a minute to even 5. Even though on_ready has not been called yet, the selfbot is connected. Very weird bug that appeared around last week, before it was normal.

Connecting with an alt that has nothing on it everything is as usual, no delay.

Code

/

Expected Results

Connect when selfbot is actually ready

Actual Results

Connecting highly delayed depending on account "size"

System Information

on phone but running 2.0 version

Checklist

Additional Information

No response

githubdontbanmeagain commented 1 year ago

I am going to investigate further into this, i think it is related to loading the servers in.

dolfies commented 1 year ago

As documented, on_ready is called when the cache is ready. This is not necessarily when the bot is connected, that's when on_connect is called.

If chunk_guilds_at_startup is enabled and you are in many chunkable guilds, you may see delays before ready is fired. Even with it off, you may still see delays if you're in many many guilds because of request_guilds, something I highly recommend you leave on if you're listening to most events (including on_message).

githubdontbanmeagain commented 1 year ago

i see, thanks