maybe this will fix user slash commands? who knows
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 36s

This commit is contained in:
Lee 2024-06-25 19:14:08 +01:00
parent f4439338f9
commit dcb125357e

@ -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);
}