Package net.dv8tion.jda.api.utils.cache
Enum CacheFlag
- All Implemented Interfaces:
Serializable,Comparable<CacheFlag>
Flags used to enable cache services for JDA.
Check the flag descriptions to see which
Check the flag descriptions to see which
intents are required to use them.-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionEnables cache forMember.getActivities()Enables cache forMember.getOnlineStatus(ClientType)Enables cache forGuild.getEmojiCache()Enables cache forIPostContainer.getAvailableTagCache()andThreadChannel.getAppliedTags()Enables cache forIPermissionContainer.getMemberPermissionOverrides()Enables cache forMember.getOnlineStatus()
This is enabled implicitly byACTIVITYandCLIENT_STATUS.Enables cache forRole.getTags()Enables cache forGuild.getScheduledEventCache()Enables cache forGuild.getStickerCache()Enables cache forMember.getVoiceState()
This will always be cached for self member. -
Method Summary
Modifier and TypeMethodDescriptionCollects all cache flags that require privileged intentsThe requiredGatewayIntentfor this cache flag.booleanWhether this cache flag is for presence information of a member.static CacheFlagReturns the enum constant of this type with the specified name.static CacheFlag[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ACTIVITY
Enables cache forMember.getActivities()Requires
GUILD_PRESENCESintent to be enabled. -
VOICE_STATE
Enables cache forMember.getVoiceState()
This will always be cached for self member.Requires
GUILD_VOICE_STATESintent to be enabled. -
EMOJI
Enables cache forGuild.getEmojiCache()Requires
GUILD_EXPRESSIONSintent to be enabled. -
STICKER
Enables cache forGuild.getStickerCache()Requires
GUILD_EXPRESSIONSintent to be enabled. -
CLIENT_STATUS
Enables cache forMember.getOnlineStatus(ClientType)Requires
GUILD_PRESENCESintent to be enabled. -
MEMBER_OVERRIDES
Enables cache forIPermissionContainer.getMemberPermissionOverrides() -
ROLE_TAGS
Enables cache forRole.getTags() -
FORUM_TAGS
Enables cache forIPostContainer.getAvailableTagCache()andThreadChannel.getAppliedTags() -
ONLINE_STATUS
Enables cache forMember.getOnlineStatus()
This is enabled implicitly byACTIVITYandCLIENT_STATUS.Requires
GUILD_PRESENCESintent to be enabled.- Since:
- 4.3.0
-
SCHEDULED_EVENTS
Enables cache forGuild.getScheduledEventCache()Requires
SCHEDULED_EVENTSintent to be enabled.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getRequiredIntent
The requiredGatewayIntentfor this cache flag.- Returns:
- The required intent, or null if no intents are required.
-
isPresence
public boolean isPresence()Whether this cache flag is for presence information of a member.- Returns:
- True, if this is for presences
-
getPrivileged
Collects all cache flags that require privileged intents- Returns:
EnumSetof the cache flags that require the privileged intents
-