mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-24 13:44:33 +00:00
introduced *all* intents abstracto requires in order to function...., because with the new version the guild members intent was not used, and various features were not functioning
added initial message also to be send
This commit is contained in:
@@ -14,12 +14,16 @@ import net.dv8tion.jda.api.entities.Emote;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.requests.GatewayIntent;
|
||||
import net.dv8tion.jda.api.utils.MemberCachePolicy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import static net.dv8tion.jda.api.requests.GatewayIntent.*;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BotServiceBean implements BotService {
|
||||
@@ -28,9 +32,12 @@ public class BotServiceBean implements BotService {
|
||||
|
||||
@Override
|
||||
public void login() throws LoginException {
|
||||
JDABuilder builder = JDABuilder.createDefault(System.getenv("TOKEN"));
|
||||
JDABuilder builder = JDABuilder.create(System.getenv("TOKEN"), GatewayIntent.GUILD_MEMBERS, GUILD_VOICE_STATES,
|
||||
GUILD_EMOJIS, GUILD_MEMBERS, GUILD_MESSAGE_REACTIONS, GUILD_MESSAGES,
|
||||
GUILD_MESSAGE_REACTIONS, DIRECT_MESSAGE_REACTIONS, DIRECT_MESSAGES, GUILD_PRESENCES);
|
||||
|
||||
builder.setBulkDeleteSplittingEnabled(false);
|
||||
builder.setMemberCachePolicy(MemberCachePolicy.ALL);
|
||||
|
||||
this.instance = builder.build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user