🌋Vulkava
Represents the main Vulkava client.
Constructor
new Vulkava(options)
Properties
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
Extends AbstractExternalSource The external source
.createPlayer()
Creates a new player or returns an existing one
options
Object The player options
options.guildId
String The guild id that player belongs to
options.voiceChannelId
String The voice channel id
options.textChannelId
String (optional) The text channel id
options.selfDeaf
Boolean (optional) Whether the bot joins the voice channel deafened or not
options.selfMute
Boolean (optional) Whether the bot joins the voice channel muted or not
options.queue
Extends AbstractQueue (optional) A custom queue implementation
The player
decodeTrack()
Decodes a single base64 encoded track into a Track instance
encodedTrack
String The base64 encoded track
decodeTracks()
Decodes multiple base64 encoded tracks into an array of 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
Object The discord gateway raw payload
search()
query
String The song term to search for
source
SEARCH_SOURCE (optional) The source to search if the query is not a valid URL, default is youtube
The search result
start()
Starts the Vulkava and connects to all lavalink nodes
clientId
String The client (bot) id
Events
>raw
Fired when any connected lavalink node emits an event
> nodeConnect
Fired when a lavalink node connects
node
Node The node that was connected
> nodeResume
Fired when a lavalink node resumes its connection (when resumeKey configured)
node
Node The node that was resumed
> nodeDisconnect
Fired when a lavalink node disconnects
> warn
Fired when something weird happened
> error
Fired when a error occurred
> debug
Event for debug messages
message
String The debug message
> trackStart
Fired when a track starts playing
> trackEnd
Fired when a track stops playing
TrackEndReason = 'FINISHED' | 'LOAD_FAILED' | 'STOPPED' | 'REPLACED' | 'CLEANUP'
> trackStuck
Fired when a track playback stucks
> trackException
Fired when a exception occurs during the track playback
> playerCreate
Fired when a player is created
player
Player The player
> playerDestroy
Fired when a player is destroyed
player
Player The 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
Player The player
code
Number The websocket close code See: discord voice close codes
reason
String The websocket close reason
> queueEnd
Fired when there is no more tracks to play on the queue
player
Player The player
> pong
Fired when a lavalink node emits a pong event (used to get lavalink latency)
> recordFinished
Fired when a lavalink node has finished processing an audio recording
> speakingStart
Fired when a user started speaking (only works while recording and if sendSpeakingEvents=true in NodeOptions)
> speakingStop
Fired when a user stopped speaking (100ms of silence) (only works while recording and if sendSpeakingEvents=true in NodeOptions)
> userDisconnect
Fired when a user disconnected from the voice channel (only works if sendSpeakingEvents=true in NodeOptions)
Last updated