LavaLyricsPlugin
API reference for the LavaLyricsPlugin in Moonlink.js
LavaLyricsPlugin Class
The LavaLyricsPlugin
integrates with the LavaLyrics Lavalink plugin to provide lyrics fetching and live lyrics subscription capabilities. It supports fetching lyrics for the current track or a specific encoded track.
This plugin requires a Lavalink server running the LavaLyrics
plugin.
Properties
Property | Type | Description |
---|---|---|
name | string | The name of the plugin: lavalyrics-plugin . |
capabilities | string[] | Declares lavalyrics capability. |
node | Node | The associated Node instance. |
Methods
load
Load Plugin
Initializes the plugin for a given node.
Parameters
Returns & Example
Returns
• void
::
unload
Unload Plugin
Cleans up plugin resources.
Parameters
Returns & Example
Returns
• void
getLyricsForCurrentTrack
Get Lyrics for Current Track
Fetches lyrics for the currently playing track of a specific player.
Parameters
Returns & Example
Returns
• Promise<ILavaLyricsObject | null>
— Lyrics data or null
if not found.
getLyricsForTrack
Get Lyrics for Track
Fetches lyrics for a specific encoded track.
Parameters
Returns & Example
Returns
• Promise<ILavaLyricsObject | null>
— Lyrics data or null
if not found.
subscribeToLiveLyrics
Subscribe to Live Lyrics
Subscribes to live lyrics updates for a specific guild.
Parameters
Returns & Example
Returns
• Promise<void>
unsubscribeFromLiveLyrics
Unsubscribe from Live Lyrics
Unsubscribes from live lyrics updates for a specific guild.
Parameters
Returns & Example
Returns
• Promise<void>
registerLyricsCallback
Register Lyrics Callback
Registers a callback function to receive live lyrics line updates for a specific guild.
Parameters
Returns & Example
Returns
• void
unregisterLyricsCallback
Unregister Lyrics Callback
Unregisters the lyrics callback function for a specific guild.
Parameters
Returns & Example
Returns
• void
handleEvent
Handle Event
Handles incoming events from the Lavalink node related to lyrics. This method is called internally by the Node.
Parameters
Returns & Example
Returns
• void