Skip to content

Commit

Permalink
Fixing connection after some idle time
Browse files Browse the repository at this point in the history
  • Loading branch information
RichtXO committed Apr 4, 2024
1 parent 4ff442c commit 1fccb80
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/richtxo/LilMo.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
import com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager;
import com.sedmelluq.discord.lavaplayer.source.AudioSourceManagers;
import com.sedmelluq.discord.lavaplayer.track.playback.NonAllocatingAudioFrameBuffer;
import discord4j.common.ReactorResources;
import discord4j.core.DiscordClientBuilder;
import discord4j.core.GatewayDiscordClient;
import discord4j.core.event.domain.interaction.ChatInputInteractionEvent;
import discord4j.core.object.presence.ClientActivity;
import discord4j.core.object.presence.ClientPresence;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import reactor.netty.http.client.HttpClient;

public class LilMo {
public static final Logger LOGGER = LoggerFactory.getLogger(LilMo.class);
Expand All @@ -27,6 +29,12 @@ public class LilMo {

public static void main(String[] args){
final GatewayDiscordClient client = DiscordClientBuilder.create(System.getenv("TOKEN"))
.setReactorResources(ReactorResources.builder()
.httpClient(HttpClient.create()
.compress(true)
.keepAlive(false)
.followRedirect(true).secure())
.build())
.build()
.gateway()
.setInitialPresence(s -> ClientPresence.online(
Expand Down

0 comments on commit 1fccb80

Please sign in to comment.