discord-voip
Discord Voice Over IP library for Discord Player
Classes
AudioPlayer
Used to play audio resources (i.e. tracks, streams) to voice connections.
AudioPlayerError
An error emitted by an AudioPlayer. Contains an attached resource to aid with debugging and identifying where the error came from.
AudioResource
Represents an audio resource that can be played by an audio player.
PlayerSubscription
Represents a subscription of a voice connection to an audio player, allowing the audio player to play audio on the voice connection.
VoiceConnection
A connection to the voice server of a Guild, can be used to play audio in voice channels.
Types
AudioPlayerBufferingState
The state that an AudioPlayer is in when it is waiting for a resource to become readable. Once this happens, the AudioPlayer will enter the Playing state. If the resource ends/errors before this, then it will re-enter the Idle state.
AudioPlayerIdleState
The state that an AudioPlayer is in when it has no resource to play. This is the starting state.
AudioPlayerPausedState
The state that an AudioPlayer is in when it has either been explicitly paused by the user, or done automatically by the AudioPlayer itself if there are no available subscribers.
AudioPlayerPlayingState
The state that an AudioPlayer is in when it is actively playing an AudioResource. When playback ends, it will enter the Idle state.
CreateAudioPlayerOptions
Options that can be passed when creating an audio player, used to specify its behavior.
CreateAudioResourceOptions
Options that are set when creating a new audio resource.
CreateVoiceConnectionOptions
The options that can be given when creating a voice connection.
DiscordGatewayAdapterImplementerMethods
Methods that are provided by the implementer of a Discord gateway DiscordGatewayAdapter.
DiscordGatewayAdapterLibraryMethods
Methods that are provided by the @discordjs/voice library to implementations of Discord gateway DiscordGatewayAdapters.
JoinConfig
Docs for type JoinConfig
JoinVoiceChannelOptions
The options that can be given when joining a voice channel.
VoiceConnectionConnectingState
The state that a VoiceConnection will be in when it is establishing a connection to a Discord voice server.
VoiceConnectionDestroyedState
The state that a VoiceConnection will be in when it has been permanently been destroyed by the user and untracked by the library. It cannot be reconnected, instead, a new VoiceConnection needs to be established.
VoiceConnectionDisconnectedBaseState
The state that a VoiceConnection will be in when it is not connected to a Discord voice server nor is it attempting to connect. You can manually attempt to reconnect using VoiceConnection#reconnect.
VoiceConnectionDisconnectedOtherState
The state that a VoiceConnection will be in when it is not connected to a Discord voice server nor is it attempting to connect. You can manually attempt to reconnect using VoiceConnection#reconnect.
VoiceConnectionDisconnectedWebSocketState
The state that a VoiceConnection will be in when its WebSocket connection was closed. You can manually attempt to reconnect using VoiceConnection#reconnect.
VoiceConnectionReadyState
The state that a VoiceConnection will be in when it has an active connection to a Discord voice server.
VoiceConnectionSignallingState
The state that a VoiceConnection will be in when it is waiting to receive a VOICE_SERVER_UPDATE and VOICE_STATE_UPDATE packet from Discord, provided by the adapter.
AudioPlayerState
The various states that the player can be in.
DiscordGatewayAdapterCreator
A function used to build adapters. It accepts a methods parameter that contains functions that can be called by the implementer when new data is received on its gateway connection. In return, the implementer will return some methods that the library can call - e.g. to send messages on the gateway, or to signal that the adapter can be removed.
VoiceConnectionDisconnectedState
The states that a VoiceConnection can be in when it is not connected to a Discord voice server nor is it attempting to connect. You can manually attempt to connect using VoiceConnection#reconnect.
VoiceConnectionState
The various states that a voice connection can be in.
Functions
createAudioPlayer
Creates a new AudioPlayer to be used.
createAudioResource
Creates an audio resource that can be played by audio players.
entersState
Allows a voice connection a specified amount of time to enter a given state, otherwise rejects with an error.
getGroups
Retrieves the map of group names to maps of voice connections. By default, all voice connections are created under the 'default' group.
getVoiceConnection
Finds a voice connection with the given guild id and group. Defaults to the 'default' group.
getVoiceConnections
Retrieves all the voice connections under the 'default' group.
joinVoiceChannel
Creates a VoiceConnection to a Discord voice channel.
Variables
Enums
AudioPlayerStatus
Docs for enum AudioPlayerStatus
NoSubscriberBehavior
Describes the behavior of the player when an audio packet is played but there are no available voice connections to play to.
StreamType
The different types of stream that can exist within the pipeline.
VoiceConnectionDisconnectReason
The reasons a voice connection can be in the disconnected state.
VoiceConnectionStatus
The various status codes a voice connection can hold at any one time.