UNPKG

disrexom

Version:

A Discord.js module to simplify your music commands and play songs with audio filters on Discord without any API key. Support YouTube, SoundCloud, Bandcamp, Facebook, and 700+ more sites

82 lines 2.36 kB
import type { Client, TextChannel } from "discord.js"; import type { DisTube, DisTubeEvents, DisTubeHandler, DisTubeVoiceManager, Options, PluginType, QueueManager, Song } from ".."; /** * DisTube Plugin * @abstract * @private */ export declare abstract class Plugin { type: PluginType; distube: DisTube; init(distube: DisTube): void; /** * Type of the plugin * @name Plugin#type * @type {PluginType} */ /** * Emit the {@link DisTube} of this base * @param {string} eventName Event name * @param {...any} args arguments * @returns {boolean} */ emit(eventName: keyof DisTubeEvents, ...args: any): boolean; /** * Emit error event * @param {Error} error error * @param {Discord.TextChannel?} channel Text channel where the error is encountered. */ emitError(error: Error, channel?: TextChannel): void; /** * The queue manager * @type {QueueManager} * @readonly */ get queues(): QueueManager; /** * The voice manager * @type {DisTubeVoiceManager} * @readonly */ get voices(): DisTubeVoiceManager; /** * Discord.js client * @type {Discord.Client} * @readonly */ get client(): Client; /** * DisTube options * @type {DisTubeOptions} * @readonly */ get options(): Options; /** * DisTube handler * @type {DisTubeHandler} * @readonly */ get handler(): DisTubeHandler; /** * Check if the url is working with this plugin * @param {string} url Input url * @returns {Promise<boolean>} */ validate(url: string): Promise<boolean>; /** * Get the stream url from {@link Song#url}. Returns {@link Song#url} by default. * Not needed if the plugin plays song from YouTube. * @param {string} url Input url * @returns {Promise<string>} */ getStreamURL(url: string): Promise<string>; /** * (Optional) Get related songs from a supported url. {@link Song#member} should be `undefined`. * Not needed to add {@link Song#related} because it will be added with this function later. * @param {string} url Input url * @returns {Promise<Song[]>} */ getRelatedSongs(url: string): Promise<Song[]>; } export default Plugin; //# sourceMappingURL=Plugin.d.ts.map