PluginManager
API reference for the PluginManager class in Moonlink.js
AbstractPlugin Class
The AbstractPlugin class serves as the base for all Moonlink.js plugins. It defines the essential structure and lifecycle methods that concrete plugin implementations must adhere to.
This is an abstract class and cannot be instantiated directly. You must extend it to create your own custom plugins.
Properties
| Property | Type | Description |
|---|---|---|
name | string | The unique name of the plugin. |
capabilities | string[] | An array of capabilities provided by this plugin (e.g., "lavadspx", "search:spotify"). |
Methods
load
Load Plugin
Called when the plugin is loaded for a specific node. This method should contain the plugin's initialization logic.
Parameters
Node instance for which the plugin is being loaded. Returns & Example
Returns
• void
class MyPlugin extends AbstractPlugin {
// ... constructor and other methods
load(node) {
node.manager.emit('debug', `MyPlugin loaded for node ${node.identifier}`);
}
}
::
unload
Unload Plugin
Called when the plugin is unloaded from a specific node. This method should contain the plugin's cleanup logic.
Parameters
Node instance from which the plugin is being unloaded. Returns & Example
Returns
• void
class MyPlugin extends AbstractPlugin {
// ... constructor and other methods
unload(node) {
node.manager.emit('debug', `MyPlugin unloaded from node ${node.identifier}`);
}
}
onNodeInfoUpdate
On Node Info Update
Optional method called when the associated node's information is updated. Useful for plugins that need to react to changes in node capabilities or other properties.
Parameters
Node instance whose information has been updated. Returns & Example
Returns
• void
class MyPlugin extends AbstractPlugin {
// ... constructor and other methods
onNodeInfoUpdate(node) {
node.manager.emit('debug', `MyPlugin received node info update for node ${node.identifier}`);
// React to updated node.info.plugins or other properties
}
}
Official Plugins
Available Plugins
List of official plugins available for Moonlink.js.
| Plugin | Description | Version |
|---|---|---|
GoogleCloudTTSPlugin | Provides Text-to-Speech (TTS) functionality using Google Cloud TTS. | N/A |
JavaLavaLyricsPlugin | Provides lyrics functionality using the Java LavaLyrics plugin. | N/A |
JavaLyricsPlugin | Provides lyrics functionality using the Java Lyrics plugin. | N/A |
LavaDSPXPlugin | Provides advanced digital signal processing (DSP) filters. | N/A |
LavaLyricsPlugin | Provides lyrics functionality using the LavaLyrics plugin. | N/A |
LavaSearchPlugin | Provides advanced search capabilities using the LavaSearch plugin. | N/A |
LavaSrcPlugin | Provides support for various music sources like Spotify, Apple Music, Deezer, etc. | N/A |
LyricsKtPlugin | Provides lyrics functionality using the Lyrics.kt plugin. | N/A |
SkybotPlugin | Provides additional search capabilities for various direct sources. | N/A |
SponsorBlockPlugin | Provides SponsorBlock integration for skipping sponsored segments in YouTube videos. | N/A |
YouTubePlugin | Provides YouTube search capabilities. | N/A |
| Native Sources | For documentation on native source integrations (e.g., Spotify, Deezer), please refer to the Sources section. | N/A |
moonlink does not yet have official plugins, nor plugins created by the community.