use of de.c0debase.bot.listener.other.GuildReadyListener in project c0debaseBot by Biospheere.
the class Codebase method initializeJDA.
/**
* @return The {@link JDA} instance fot the current session
* @throws Exception
*/
private JDA initializeJDA() throws Exception {
try {
final JDABuilder jdaBuilder = JDABuilder.createDefault(System.getenv("DISCORD_TOKEN"));
jdaBuilder.setEnabledIntents(GatewayIntent.getIntents(GatewayIntent.ALL_INTENTS));
jdaBuilder.setMemberCachePolicy(MemberCachePolicy.ALL);
jdaBuilder.setActivity(Activity.playing("auf c0debase"));
jdaBuilder.addEventListeners(new GuildReadyListener(this));
return jdaBuilder.build().awaitReady();
} catch (Exception exception) {
logger.error("Encountered exception while initializing JDA!");
throw exception;
}
}
Aggregations