Package net.dv8tion.jda.api.utils
Interface ChunkingFilter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Filter function for member chunking of guilds.
The filter decides based on the provided guild id whether chunking should be done on guild initialization.
The filter decides based on the provided guild id whether chunking should be done on guild initialization.
To use chunking, the GUILD_MEMBERS
intent must be enabled!
Otherwise you must use NONE
!
- Since:
- 4.1.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ChunkingFilter
Chunk all guildsstatic final ChunkingFilter
Do not chunk any guilds (lazy loading) -
Method Summary
Modifier and TypeMethodDescriptionstatic ChunkingFilter
exclude
(long... ids) Factory method to disable chunking for a blacklist of guild ids.boolean
filter
(long guildId) Decide whether the specified guild should chunk members.static ChunkingFilter
include
(long... ids) Factory method to chunk a whitelist of guild ids.
-
Field Details
-
ALL
Chunk all guilds -
NONE
Do not chunk any guilds (lazy loading)
-
-
Method Details
-
filter
boolean filter(long guildId) Decide whether the specified guild should chunk members.- Parameters:
guildId
- The guild id- Returns:
- True, if this guild should chunk
-
include
Factory method to chunk a whitelist of guild ids.
All guilds that are not mentioned will use lazy loading.This is useful to only chunk specific guilds like the hub server of a bot.
- Parameters:
ids
- The ids that should be chunked- Returns:
- The resulting filter
-
exclude
Factory method to disable chunking for a blacklist of guild ids.
All guilds that are not mentioned will use chunking.This is useful when the bot is only in one very large server that takes most of its memory and should be ignored instead.
- Parameters:
ids
- The ids that should not be chunked- Returns:
- The resulting filter
-