Source Resolver Plugin
Want to use any suitable music platform but can't find the official plugin? You can make it yourself right here!
Understanding how plugin works
Basically, the way it works will be similar to a regular plugin, but it will have stricter conditions so that you can search on lavalink and still be able to fallback to the plugin.
Requirements
- Using
rainlink
package. - Extend
SourceRainlinkPlugin
class. - Class named
RainlinkPlugin
. - Have
name()
function return the name of that plugin. - Have
type()
function return the type of that plugin usingRainlinkPluginType
enum. In this article, we will usesourceResolver
- Have
load()
function to load all the modded function of that plugin. - Have
unload()
function to unload all the modded function of that plugin. - Have
sourceName()
function return the name of that source. (For search from Lavalink, if it now avaliable, you can fill anything you want) - Have
sourceIdentify()
function return the ID of that source. (For search from Lavalink, if it now avaliable, you can fill anything you want)
Do you know?
You can check all the requirement on src/Plugin/SourceRainlinkPlugin.ts
in official repo.
Example source plugin:
Table of Contents