@kattowo/distube 6.0.0 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -88,14 +88,17 @@ DisTube ships no music source. Every source is a plugin, so a bot loads the ones
88
88
 
89
89
  ```javascript
90
90
  const { DisTube } = require("@kattowo/distube");
91
- const { YoutubePlugin } = require("@distube/youtube");
92
- const { SpotifyPlugin } = require("@distube/spotify");
91
+ const { MyPlugin } = require("./my-plugin.js");
93
92
 
94
93
  const distube = new DisTube(client, {
95
- plugins: [new YoutubePlugin(), new SpotifyPlugin()],
94
+ plugins: [new MyPlugin()],
96
95
  });
97
96
  ```
98
97
 
98
+ This fork does not maintain the plugins of the upstream repository. They may not work with it, and
99
+ they are not covered by the tests of this fork. Write your own extractor, or use a plugin that you
100
+ trust and that you can keep up to date.
101
+
99
102
  A plugin that cannot hand out a static URL to FFmpeg registers a handler on the shared stream server
100
103
  of DisTube, so the bot runs one HTTP server instead of one per plugin.
101
104
 
@@ -103,7 +106,7 @@ of DisTube, so the bot runs one HTTP server instead of one per plugin.
103
106
  play options routes a query to a single source:
104
107
 
105
108
  ```javascript
106
- const result = await distube.search("never gonna give you up", { source: "youtube" });
109
+ const result = await distube.search("never gonna give you up", { source: "my-source" });
107
110
  ```
108
111
 
109
112
  ## Documentation
package/dist/index.d.mts CHANGED
@@ -321,7 +321,7 @@ interface SongInfo<T = unknown> {
321
321
  */
322
322
  plugin: DisTubePlugin | null;
323
323
  /**
324
- * The identifier of the source of the song, e.g. `youtube`.
324
+ * The identifier of the source of the song, e.g. `my-source`.
325
325
  */
326
326
  source: string;
327
327
  /**
@@ -405,7 +405,7 @@ interface SongInfo<T = unknown> {
405
405
  */
406
406
  interface PlaylistInfo {
407
407
  /**
408
- * The identifier of the source of the playlist, e.g. `youtube`.
408
+ * The identifier of the source of the playlist, e.g. `my-source`.
409
409
  */
410
410
  source: string;
411
411
  /**
@@ -2651,7 +2651,7 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
2651
2651
  * @returns The DisTube instance
2652
2652
  * @example
2653
2653
  * ```ts
2654
- * const distube = await DisTube.create(client, { plugins: [new YoutubePlugin()] });
2654
+ * const distube = await DisTube.create(client, { plugins: [new MyPlugin()] });
2655
2655
  * ```
2656
2656
  */
2657
2657
  static create(client: Client, opts?: DisTubeOptions): Promise<DisTube>;
@@ -2716,12 +2716,12 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
2716
2716
  *
2717
2717
  * It matches the {@link Plugin.source} of the plugin, or one of its
2718
2718
  * {@link Plugin.aliases}. The identifier of the class is used when the
2719
- * plugin does not define a source (`YoutubePlugin` -> `youtube`).
2719
+ * plugin does not define a source (`MyPlugin` -> `myplugin`).
2720
2720
  * @param source - The identifier of the source
2721
2721
  * @returns The plugin, or `undefined` when there is none
2722
2722
  * @example
2723
2723
  * ```ts
2724
- * const plugin = distube.getPlugin("youtube");
2724
+ * const plugin = distube.getPlugin("myplugin");
2725
2725
  * ```
2726
2726
  */
2727
2727
  getPlugin(source: string): DisTubePlugin | undefined;
@@ -2844,7 +2844,7 @@ declare abstract class Plugin {
2844
2844
  * The identifier of the source of the plugin.
2845
2845
  *
2846
2846
  * It defaults to the name of the class, lowercased, without the `Plugin`
2847
- * suffix (`YoutubePlugin` -> `youtube`).
2847
+ * suffix (`MyPlugin` -> `myplugin`).
2848
2848
  *
2849
2849
  * It is used to route a search to a plugin, and to find a plugin with
2850
2850
  * {@link DisTube#getPlugin}.
@@ -2983,7 +2983,7 @@ declare abstract class ExtractorPlugin extends Plugin {
2983
2983
  abstract resolve<T>(url: string, options: ResolveOptions<T>): Awaitable<Song<T> | Playlist<T>>;
2984
2984
  /**
2985
2985
  * Get the stream url from {@link Song#url}. Returns {@link Song#url} by default.
2986
- * Not needed if the plugin plays song from YouTube.
2986
+ * Not needed if the plugin plays the song itself.
2987
2987
  * @param song - Input song
2988
2988
  * @returns The url of the audio stream
2989
2989
  */
@@ -3056,7 +3056,7 @@ declare abstract class PlayableExtractorPlugin extends ExtractorPlugin {
3056
3056
  abstract resolve<T>(url: string, options: ResolveOptions<T>): Awaitable<Song<T> | Playlist<T>>;
3057
3057
  /**
3058
3058
  * Get the stream url from {@link Song#url}. Returns {@link Song#url} by default.
3059
- * Not needed if the plugin plays song from YouTube.
3059
+ * Not needed if the plugin plays the song itself.
3060
3060
  * @param song - Input song
3061
3061
  * @returns The url of the audio stream
3062
3062
  */
package/dist/index.d.ts CHANGED
@@ -321,7 +321,7 @@ interface SongInfo<T = unknown> {
321
321
  */
322
322
  plugin: DisTubePlugin | null;
323
323
  /**
324
- * The identifier of the source of the song, e.g. `youtube`.
324
+ * The identifier of the source of the song, e.g. `my-source`.
325
325
  */
326
326
  source: string;
327
327
  /**
@@ -405,7 +405,7 @@ interface SongInfo<T = unknown> {
405
405
  */
406
406
  interface PlaylistInfo {
407
407
  /**
408
- * The identifier of the source of the playlist, e.g. `youtube`.
408
+ * The identifier of the source of the playlist, e.g. `my-source`.
409
409
  */
410
410
  source: string;
411
411
  /**
@@ -2651,7 +2651,7 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
2651
2651
  * @returns The DisTube instance
2652
2652
  * @example
2653
2653
  * ```ts
2654
- * const distube = await DisTube.create(client, { plugins: [new YoutubePlugin()] });
2654
+ * const distube = await DisTube.create(client, { plugins: [new MyPlugin()] });
2655
2655
  * ```
2656
2656
  */
2657
2657
  static create(client: Client, opts?: DisTubeOptions): Promise<DisTube>;
@@ -2716,12 +2716,12 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
2716
2716
  *
2717
2717
  * It matches the {@link Plugin.source} of the plugin, or one of its
2718
2718
  * {@link Plugin.aliases}. The identifier of the class is used when the
2719
- * plugin does not define a source (`YoutubePlugin` -> `youtube`).
2719
+ * plugin does not define a source (`MyPlugin` -> `myplugin`).
2720
2720
  * @param source - The identifier of the source
2721
2721
  * @returns The plugin, or `undefined` when there is none
2722
2722
  * @example
2723
2723
  * ```ts
2724
- * const plugin = distube.getPlugin("youtube");
2724
+ * const plugin = distube.getPlugin("myplugin");
2725
2725
  * ```
2726
2726
  */
2727
2727
  getPlugin(source: string): DisTubePlugin | undefined;
@@ -2844,7 +2844,7 @@ declare abstract class Plugin {
2844
2844
  * The identifier of the source of the plugin.
2845
2845
  *
2846
2846
  * It defaults to the name of the class, lowercased, without the `Plugin`
2847
- * suffix (`YoutubePlugin` -> `youtube`).
2847
+ * suffix (`MyPlugin` -> `myplugin`).
2848
2848
  *
2849
2849
  * It is used to route a search to a plugin, and to find a plugin with
2850
2850
  * {@link DisTube#getPlugin}.
@@ -2983,7 +2983,7 @@ declare abstract class ExtractorPlugin extends Plugin {
2983
2983
  abstract resolve<T>(url: string, options: ResolveOptions<T>): Awaitable<Song<T> | Playlist<T>>;
2984
2984
  /**
2985
2985
  * Get the stream url from {@link Song#url}. Returns {@link Song#url} by default.
2986
- * Not needed if the plugin plays song from YouTube.
2986
+ * Not needed if the plugin plays the song itself.
2987
2987
  * @param song - Input song
2988
2988
  * @returns The url of the audio stream
2989
2989
  */
@@ -3056,7 +3056,7 @@ declare abstract class PlayableExtractorPlugin extends ExtractorPlugin {
3056
3056
  abstract resolve<T>(url: string, options: ResolveOptions<T>): Awaitable<Song<T> | Playlist<T>>;
3057
3057
  /**
3058
3058
  * Get the stream url from {@link Song#url}. Returns {@link Song#url} by default.
3059
- * Not needed if the plugin plays song from YouTube.
3059
+ * Not needed if the plugin plays the song itself.
3060
3060
  * @param song - Input song
3061
3061
  * @returns The url of the audio stream
3062
3062
  */
package/dist/index.js CHANGED
@@ -96,7 +96,7 @@ __export(index_exports, {
96
96
  module.exports = __toCommonJS(index_exports);
97
97
 
98
98
  // src/constant.ts
99
- var version = "6.0.0";
99
+ var version = "6.0.2";
100
100
  var AUDIO_SAMPLE_RATE = 48e3;
101
101
  var AUDIO_CHANNELS = 2;
102
102
  var DEFAULT_VOLUME = 50;
@@ -3409,7 +3409,7 @@ var DisTube = class _DisTube extends import_tiny_typed_emitter3.TypedEmitter {
3409
3409
  * @returns The DisTube instance
3410
3410
  * @example
3411
3411
  * ```ts
3412
- * const distube = await DisTube.create(client, { plugins: [new YoutubePlugin()] });
3412
+ * const distube = await DisTube.create(client, { plugins: [new MyPlugin()] });
3413
3413
  * ```
3414
3414
  */
3415
3415
  static async create(client, opts = {}) {
@@ -3606,12 +3606,12 @@ ${e.message}`;
3606
3606
  *
3607
3607
  * It matches the {@link Plugin.source} of the plugin, or one of its
3608
3608
  * {@link Plugin.aliases}. The identifier of the class is used when the
3609
- * plugin does not define a source (`YoutubePlugin` -> `youtube`).
3609
+ * plugin does not define a source (`MyPlugin` -> `myplugin`).
3610
3610
  * @param source - The identifier of the source
3611
3611
  * @returns The plugin, or `undefined` when there is none
3612
3612
  * @example
3613
3613
  * ```ts
3614
- * const plugin = distube.getPlugin("youtube");
3614
+ * const plugin = distube.getPlugin("myplugin");
3615
3615
  * ```
3616
3616
  */
3617
3617
  getPlugin(source) {
@@ -3730,7 +3730,7 @@ var Plugin = class {
3730
3730
  * The identifier of the source of the plugin.
3731
3731
  *
3732
3732
  * It defaults to the name of the class, lowercased, without the `Plugin`
3733
- * suffix (`YoutubePlugin` -> `youtube`).
3733
+ * suffix (`MyPlugin` -> `myplugin`).
3734
3734
  *
3735
3735
  * It is used to route a search to a plugin, and to find a plugin with
3736
3736
  * {@link DisTube#getPlugin}.