Star ✨ on GitHub

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.

Properties

PropertyTypeDescription
namestringThe unique name of the plugin.
capabilitiesstring[]An array of capabilities provided by this plugin (e.g., "lavadspx", "search:spotify").

Methods

load

loadmethod

Load Plugin

Called when the plugin is loaded for a specific node. This method should contain the plugin's initialization logic.

Parameters
noderequiredNode
The Node instance for which the plugin is being loaded.

Returns & Example

Returnsvoid

class MyPlugin extends AbstractPlugin {
  // ... constructor and other methods
  load(node) {
    node.manager.emit('debug', `MyPlugin loaded for node ${node.identifier}`);
  }
}

::

unload

unloadmethod

Unload Plugin

Called when the plugin is unloaded from a specific node. This method should contain the plugin's cleanup logic.

Parameters
noderequiredNode
The Node instance from which the plugin is being unloaded.

Returns & Example

Returnsvoid

class MyPlugin extends AbstractPlugin {
  // ... constructor and other methods
  unload(node) {
    node.manager.emit('debug', `MyPlugin unloaded from node ${node.identifier}`);
  }
}

onNodeInfoUpdate

onNodeInfoUpdatemethod

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
noderequiredNode
The Node instance whose information has been updated.

Returns & Example

Returnsvoid

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.

PluginDescriptionVersion
GoogleCloudTTSPluginProvides Text-to-Speech (TTS) functionality using Google Cloud TTS.N/A
JavaLavaLyricsPluginProvides lyrics functionality using the Java LavaLyrics plugin.N/A
JavaLyricsPluginProvides lyrics functionality using the Java Lyrics plugin.N/A
LavaDSPXPluginProvides advanced digital signal processing (DSP) filters.N/A
LavaLyricsPluginProvides lyrics functionality using the LavaLyrics plugin.N/A
LavaSearchPluginProvides advanced search capabilities using the LavaSearch plugin.N/A
LavaSrcPluginProvides support for various music sources like Spotify, Apple Music, Deezer, etc.N/A
LyricsKtPluginProvides lyrics functionality using the Lyrics.kt plugin.N/A
SkybotPluginProvides additional search capabilities for various direct sources.N/A
SponsorBlockPluginProvides SponsorBlock integration for skipping sponsored segments in YouTube videos.N/A
YouTubePluginProvides YouTube search capabilities.N/A
Native SourcesFor documentation on native source integrations (e.g., Spotify, Deezer), please refer to the Sources section.N/A