discord4j.voice.VoiceConnection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of discord4j-voice Show documentation
Show all versions of discord4j-voice Show documentation
A JVM-based REST/WS wrapper for the official Discord Bot API
package discord4j.voice;
/**
* Allows for manipulation of an already-established voice connection.
*/
public class VoiceConnection {
private final VoiceGatewayClient vgw;
private final Runnable leaveChannel;
VoiceConnection(VoiceGatewayClient vgw, Runnable leaveChannel) {
this.vgw = vgw;
this.leaveChannel = leaveChannel;
}
public void disconnect() {
vgw.stop();
leaveChannel.run();
}
}