Vulkava
Represents the main Vulkava client.
Constructor
new Vulkava(options)
options
The Vulkava options
Properties
nodes
The lavalink node array
clientId
The bot id
players
The players map
Methods and events
---
---
---
---
---
---
---
---
---
---
---
---
* This events only work on my custom lavalink, the speakingStart, speakingStop and userDisconnect are only emitted if sendSpeakingEvents is true, in NodeOptions. The speakingStart and speakingStop are only emitted while the lavalink node is recording audio.
Methods
.addExternalSource()
Adds an external source that produces a SearchResult with UnresolvedTracks
source
.createPlayer()
Creates a new player or returns an existing one
options
options.guildId
options.voiceChannelId
options.textChannelId
options.selfDeaf
options.selfMute
options.queue
The player
decodeTrack()
Decodes a single base64 encoded track into a Track instance
encodedTrack
The decoded track
decodeTracks()
Decodes multiple base64 encoded tracks into an array of Tracks
encodedTracks
The decoded tracks
handleVoiceUpdate()
Handles voice state & voice server update packets and pipes them into the lavalink node
This method is meant to be used on the raw event listener of d.js and rawWS (eris) and requires the gateway intent `GUILD_VOICE_STATES` in order to work properly.
payload
search()
query
source
The search result
start()
Starts the Vulkava and connects to all lavalink nodes
clientId
Events
>raw
Fired when any connected lavalink node emits an event
node
payload
> nodeConnect
Fired when a lavalink node connects
node
> nodeResume
Fired when a lavalink node resumes its connection (when resumeKey configured)
node
> nodeDisconnect
Fired when a lavalink node disconnects
node
code
reason
> warn
Fired when something weird happened
node
warn
> error
Fired when a error occurred
node
error
> debug
Event for debug messages
message
> trackStart
Fired when a track starts playing
player
track
> trackEnd
Fired when a track stops playing
player
track
reason
TrackEndReason The reason why the track stopped playing
TrackEndReason = 'FINISHED' | 'LOAD_FAILED' | 'STOPPED' | 'REPLACED' | 'CLEANUP'
> trackStuck
Fired when a track playback stucks
player
track
thresholdMs
> trackException
Fired when a exception occurs during the track playback
player
track
exception
exception.message
exception.severity
'COMMON' | 'SUSPICIOUS' | 'FAULT' The exception severity
exception.cause
> playerCreate
Fired when a player is created
player
> playerDestroy
Fired when a player is destroyed
player
> playerDisconnect
Fired when a player gets disconnected from the discord voice server (Vulkava auto-reconnects on close codes: 1006, 4015, 4006 and 4009)
player
code
reason
> queueEnd
Fired when there is no more tracks to play on the queue
player
> pong
Fired when a lavalink node emits a pong event (used to get lavalink latency)
node
ping
> recordFinished
Fired when a lavalink node has finished processing an audio recording
node
guildId
id
> speakingStart
Fired when a user started speaking (only works while recording and if sendSpeakingEvents=true in NodeOptions)
player
userId
> speakingStop
Fired when a user stopped speaking (100ms of silence) (only works while recording and if sendSpeakingEvents=true in NodeOptions)
player
userId
> userDisconnect
Fired when a user disconnected from the voice channel (only works if sendSpeakingEvents=true in NodeOptions)
player
userId
Last updated