Cache MemberOverrides

java-rewrite
Hammy 3 years ago
parent c362d375d7
commit 7fad02e666

@ -20,6 +20,7 @@ import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.entities.Activity; import net.dv8tion.jda.api.entities.Activity;
import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.requests.GatewayIntent; import net.dv8tion.jda.api.requests.GatewayIntent;
import net.dv8tion.jda.api.utils.MemberCachePolicy;
import net.dv8tion.jda.api.utils.cache.CacheFlag; import net.dv8tion.jda.api.utils.cache.CacheFlag;
@Factory @Factory
@ -46,21 +47,23 @@ public class BotConfig {
return JDABuilder return JDABuilder
.createDefault(token) .createDefault(token)
.setActivity(Activity.playing("With Hamothy")) .setActivity(Activity.playing("With Hamothy"))
.setMemberCachePolicy(MemberCachePolicy.ALL)
.addEventListeners( .addEventListeners(
new OnReadyListener(), new OnReadyListener(),
new SlashCommandListener(commandHandler) new SlashCommandListener(commandHandler)
) )
.enableIntents( .enableIntents(
List.of( List.of(
GatewayIntent.GUILD_MEMBERS, GatewayIntent.GUILD_MESSAGE_REACTIONS,
GatewayIntent.GUILD_VOICE_STATES,
GatewayIntent.GUILD_PRESENCES, GatewayIntent.GUILD_PRESENCES,
GatewayIntent.GUILD_MESSAGES, GatewayIntent.GUILD_MESSAGES,
GatewayIntent.GUILD_VOICE_STATES, GatewayIntent.GUILD_MEMBERS,
GatewayIntent.GUILD_EMOJIS, GatewayIntent.GUILD_EMOJIS
GatewayIntent.GUILD_MESSAGE_REACTIONS
) )
) )
.enableCache( .enableCache(
CacheFlag.MEMBER_OVERRIDES,
CacheFlag.ONLINE_STATUS, CacheFlag.ONLINE_STATUS,
CacheFlag.VOICE_STATE, CacheFlag.VOICE_STATE,
CacheFlag.ROLE_TAGS, CacheFlag.ROLE_TAGS,

Loading…
Cancel
Save