Intents & Caching
EnhancedJDA allows to set intents and caching really easily. If you don’t know what it is, read about it in JDA documentation. You can set these variables using annotations in the main class.
dev.projectenhanced.enhancedjda.discord.EnableIntents
public @interface EnableIntents {
GatewayIntent[] value() default {};
}
dev.projectenhanced.enhancedjda.discord.EnableCaching
public @interface EnableCaching {
MemberCachePolicyType policy();
ChunkingFilterType filter();
CacheFlag[] flags() default {};
}
Example:
@EnableIntents({GatewayIntent.GUILD_PRESENCES, GatewayIntent.GUILD_MEMBERS})
@EnableCaching(
policy = MemberCachePolicyType.ALL,
filter = ChunkingFilterType.ALL,
flags = {CacheFlag.CLIENT_STATUS}
)
public class Main extends EnhancedBot {
// ...
}