use of com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory in project MantaroBot by Mantaro.
the class MantaroShard method restartJDA.
public void restartJDA(boolean force) throws RateLimitedException, LoginException, InterruptedException {
if (jda != null) {
log.info("Attempting to drop shard #" + shardId);
if (!force)
prepareShutdown();
jda.shutdown(false);
log.info("Dropped shard #" + shardId);
}
JDABuilder jdaBuilder = new JDABuilder(AccountType.BOT).setToken(config().get().token).setEventManager(manager).setAudioSendFactory(new NativeAudioSendFactory()).setAutoReconnect(true).setCorePoolSize(10).setGame(Game.of("Hold on to your seatbelts!"));
if (totalShards > 1)
jdaBuilder.useSharding(shardId, totalShards);
jda = jdaBuilder.buildBlocking();
readdListeners();
}
Aggregations