SponsorBlockPlugin
API reference for the SponsorBlockPlugin in Moonlink.js
SponsorBlockPlugin Class
The SponsorBlockPlugin
integrates with the SponsorBlock Lavalink plugin to provide functionality for skipping sponsored segments in YouTube videos. It also handles loading and starting chapters.
This plugin requires a Lavalink server running the SponsorBlock
plugin.
Properties
Property | Type | Description |
---|---|---|
name | string | The name of the plugin: sponsorblock-plugin . |
capabilities | string[] | Currently empty, but can declare capabilities related to SponsorBlock. |
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
getCategories
Get Categories
Retrieves the currently configured SponsorBlock categories for a guild.
Parameters
Returns & Example
Returns
• Promise<string[]>
— An array of category strings.
setCategories
Set Categories
Sets the SponsorBlock categories for a guild.
Parameters
Returns & Example
Returns
• Promise<void>
clearCategories
Clear Categories
Clears all configured SponsorBlock categories for a guild.
Parameters
Returns & Example
Returns
• Promise<void>
handleEvent
Handle Event
Handles incoming events from the Lavalink node related to SponsorBlock. This method is called internally by the Node.
Parameters
Returns & Example
Returns
• void