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 using RainlinkPluginType enum. In this article, we will use sourceResolver
  • 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:

NameTypeLinkAuthor
rainlink-nicoOfficialnpmjs / githubRainyXeon
rainlink-deezerOfficialnpmjs / githubRainyXeon
rainlink-appleOfficialnpmjs / githubRainyXeon
rainlink-spotifyOfficialnpmjs / githubRainyXeon