-
-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy Loading #1046
Merged
Merged
Lazy Loading #1046
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MinnDevelopment
commented
Jul 8, 2019
src/main/java/net/dv8tion/jda/internal/entities/EntityBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/handle/GuildMemberAddHandler.java
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/handle/PresenceUpdateHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/handle/VoiceStateUpdateHandler.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
# Conflicts: # src/main/java/net/dv8tion/jda/internal/handle/GuildSetupController.java
This comment has been minimized.
This comment has been minimized.
This is very useful for managing roles through reactions which cannot always provide a user/member
MinnDevelopment
requested review from
DV8FromTheWorld
and removed request for
DV8FromTheWorld
November 24, 2019 06:34
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Pull Request Etiquette
Changes
Closes Issue: NaN
Description
Implementation for lazy loading of guild members. This will disable the member chunking performed when the guild is received and instead load members as they appear. This obviously removes a lot of information but can be very useful for large bots that see a lot of members which are never active.
The only information missing when creating a member from a presence update seems to be the join date, we could in theory just disable this caching during lazy loading. Currently I just set the join date to the guild creation time instead.
You can dynamically load the entire member cache for a guild or single members.
This also adds support for disabling
guild_subscriptions
which disables all guild subscriptions such as presence and typing events.When guild subscriptions are disabled the user cache becomes inconsistent as discord will not inform us of updates directly. However, we can update the cached users through message and voice state events and REST calls.We disable the user cache completely in this case because there are no member update events so there is no way to make a working system of caching them. The only users that get cached are users who participate in voice channels.
Example