From dcb125357e3e51b50b10a6b8bce0364b47006f28 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 25 Jun 2024 19:14:08 +0100 Subject: [PATCH] maybe this will fix user slash commands? who knows --- .../cc/fascinated/bat/service/DiscordService.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/service/DiscordService.java b/src/main/java/cc/fascinated/bat/service/DiscordService.java index 4e89a3a..f801f15 100644 --- a/src/main/java/cc/fascinated/bat/service/DiscordService.java +++ b/src/main/java/cc/fascinated/bat/service/DiscordService.java @@ -6,6 +6,7 @@ import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDABuilder; import net.dv8tion.jda.api.entities.Activity; import net.dv8tion.jda.api.requests.GatewayIntent; +import net.dv8tion.jda.api.utils.cache.CacheFlag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -34,11 +35,20 @@ public class DiscordService { public DiscordService( @Value("${discord.token}") String token ) throws Exception { - JDA = JDABuilder.createLight(token, EnumSet.of( + JDA = JDABuilder.create(token, EnumSet.of( GatewayIntent.GUILD_MESSAGES, GatewayIntent.MESSAGE_CONTENT, GatewayIntent.GUILD_MEMBERS - )).build() + )) + .disableCache( + CacheFlag.ACTIVITY, + CacheFlag.VOICE_STATE, + CacheFlag.EMOJI, + CacheFlag.STICKER, + CacheFlag.CLIENT_STATUS, + CacheFlag.ONLINE_STATUS, + CacheFlag.SCHEDULED_EVENTS + ).build() .awaitReady(); TimerUtils.scheduleRepeating(this::updateActivity, 0, 1000 * 60 * 2); }