Package net.dv8tion.jda.api.audio.hooks
Enum ConnectionStatus
- All Implemented Interfaces:
Serializable
,Comparable<ConnectionStatus>
Represents the connection status of an audio connection.
-
Enum Constant Summary
Enum ConstantDescriptionIndicates that the audio connection was closed due to theRegion
of the audio connection being changed.The audio connection has been successfully setup and is ready for use.JDA successfully authenticated the audio websocket and it now attempting UDP discovery.JDA has connected the audio websocket to Discord and has sent the authentication information, awaiting reply.JDA is waiting on Discord to send a valid endpoint which to connect the audio websocket to.After determining our external ip and port, JDA forwards this information to Discord so that it can send audio packets for us to properly receive.JDA has received a valid endpoint and is attempting to setup and connect the audio websocketIndicates that our token was not valid.Indicates that the channel which the audio connection was connected to was deleted, thus the connection was severed.Indicates that we were kicked from a channel by a moderatorIndicates that the logged in account lost thePermission.VOICE_CONNECT
and cannot connect to the channel.Indicates that the logged in account was removed from theGuild
while reconnecting to the gatewayIndicates that the logged in account was removed from theGuild
that this audio connection was connected to, thus the connection was severed.Indicates that the audio WebSocket was unable to resume an active session.Occurs when it takes longer thanAudioManager.getConnectTimeout()
to establish the Websocket connection and setup the UDP connection.Indicates that the connection was lost, either via UDP socket problems or the audio Websocket disconnecting.Indicates that the UDP setup failed.Indicates that the audio WebSocket was unable to complete a handshake with discord, because discord did not provide any supported encryption modes.Indicates that the audio Websocket was unable to connect to discord.Indicates that there is no open connection or that the connection was closed by choice, not by error.Indicates that JDA was shutdown and no further connections should be established -
Method Summary
Modifier and TypeMethodDescriptionboolean
static ConnectionStatus
Returns the enum constant of this type with the specified name.static ConnectionStatus[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NOT_CONNECTED
Indicates that there is no open connection or that the connection was closed by choice, not by error. -
SHUTTING_DOWN
Indicates that JDA was shutdown and no further connections should be established -
CONNECTING_AWAITING_ENDPOINT
JDA is waiting on Discord to send a valid endpoint which to connect the audio websocket to. -
CONNECTING_AWAITING_WEBSOCKET_CONNECT
JDA has received a valid endpoint and is attempting to setup and connect the audio websocket -
CONNECTING_AWAITING_AUTHENTICATION
JDA has connected the audio websocket to Discord and has sent the authentication information, awaiting reply. -
CONNECTING_ATTEMPTING_UDP_DISCOVERY
JDA successfully authenticated the audio websocket and it now attempting UDP discovery. UDP discovery involves opening a UDP socket and sending a packet to a provided Discord remote resource which responds with the external ip and port which the packet was sent from. -
CONNECTING_AWAITING_READY
After determining our external ip and port, JDA forwards this information to Discord so that it can send audio packets for us to properly receive. At this point, JDA is waiting for final websocket READY. -
CONNECTED
The audio connection has been successfully setup and is ready for use. -
DISCONNECTED_LOST_PERMISSION
Indicates that the logged in account lost thePermission.VOICE_CONNECT
and cannot connect to the channel. -
DISCONNECTED_CHANNEL_DELETED
Indicates that the channel which the audio connection was connected to was deleted, thus the connection was severed. -
DISCONNECTED_REMOVED_FROM_GUILD
Indicates that the logged in account was removed from theGuild
that this audio connection was connected to, thus the connection was severed. -
DISCONNECTED_KICKED_FROM_CHANNEL
Indicates that we were kicked from a channel by a moderator -
DISCONNECTED_REMOVED_DURING_RECONNECT
Indicates that the logged in account was removed from theGuild
while reconnecting to the gateway -
DISCONNECTED_AUTHENTICATION_FAILURE
Indicates that our token was not valid. -
AUDIO_REGION_CHANGE
Indicates that the audio connection was closed due to theRegion
of the audio connection being changed. JDA will automatically attempt to reconnect the audio connection regardless of the value of theAudioManager.isAutoReconnect()
. -
ERROR_LOST_CONNECTION
Indicates that the connection was lost, either via UDP socket problems or the audio Websocket disconnecting.
This is typically caused by a brief loss of internet which results in connection loss.
JDA automatically attempts to resume the session when this error occurs. -
ERROR_CANNOT_RESUME
Indicates that the audio WebSocket was unable to resume an active session.
JDA automatically attempts to reconnect when this error occurs. -
ERROR_WEBSOCKET_UNABLE_TO_CONNECT
Indicates that the audio Websocket was unable to connect to discord. This could be due to an internet problem causing a connection problem or an error on Discord's side (possibly due to load)
JDA automatically attempts to reconnect when this error occurs. -
ERROR_UNSUPPORTED_ENCRYPTION_MODES
Indicates that the audio WebSocket was unable to complete a handshake with discord, because discord did not provide any supported encryption modes.
JDA automatically attempts to reconnect when this error occurs. -
ERROR_UDP_UNABLE_TO_CONNECT
Indicates that the UDP setup failed. This is caused when JDA cannot properly communicate with Discord to discover the system's external IP and port which audio data will be sent from. Typically caused by an internet problem or an overly aggressive NAT port table.
JDA automatically attempts to reconnect when this error occurs. -
ERROR_CONNECTION_TIMEOUT
Occurs when it takes longer thanAudioManager.getConnectTimeout()
to establish the Websocket connection and setup the UDP connection.
JDA automatically attempts to reconnect when this error occurs.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
shouldReconnect
public boolean shouldReconnect()
-