Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We're (Discord) moving to a method of lazy-loading guilds to help with extremely large
READY
packets. With this new method, clients will now receive only the 'id' and 'unavailable' fields for every guild in theREADY
packet, and will lazily receiveGUILD_CREATE
events for those guilds as they are connected by our backend.Previously discordgo used the Guild objects originally passed in the
READY
payload as the base object for all future events, however with this new method we now case this to when the original guild is not unavailable.Something this commit does not add, but may be helpful is a way to detect the difference between
GUILD_CREATE
's used for the handshake process, vsGUILD_CREATE
's that actually represent a guild being created/added. Due to the way the state works right now, the handler is always called before any of the users and therefore you cannot compare the state before/after the GUILD_CREATE to understand whether it is a new or lazily loaded guild.👀 @iopred @bwmarrin