Search in sources :

Example 1 with NativeAudioSendFactory

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();
}
Also used : JDABuilder(net.dv8tion.jda.core.JDABuilder) NativeAudioSendFactory(com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory)

Aggregations

NativeAudioSendFactory (com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory)1 JDABuilder (net.dv8tion.jda.core.JDABuilder)1