distube 4.1.1 → 4.2.1

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/dist/index.d.ts CHANGED
@@ -6,147 +6,211 @@ import ytpl from '@distube/ytpl';
6
6
  import { Video, Playlist as Playlist$1 } from '@distube/ytsr';
7
7
  import { TypedEmitter } from 'tiny-typed-emitter';
8
8
  import { AudioPlayer, VoiceConnection, AudioResource, StreamType as StreamType$1 } from '@discordjs/voice';
9
- import { FFmpeg } from 'prism-media';
10
- import * as _discordjs_collection from '@discordjs/collection';
9
+ import { PassThrough } from 'node:stream';
10
+ import { ChildProcess } from 'child_process';
11
11
 
12
12
  type Awaitable<T = any> = T | PromiseLike<T>;
13
- type DisTubeVoiceEvents = {
14
- disconnect: (error?: Error) => Awaitable;
15
- error: (error: Error) => Awaitable;
16
- finish: () => Awaitable;
17
- };
18
13
  type DisTubeEvents = {
19
- error: [channel: GuildTextBasedChannel | undefined, error: Error];
20
14
  addList: [queue: Queue, playlist: Playlist];
21
15
  addSong: [queue: Queue, song: Song];
22
- playSong: [queue: Queue, song: Song];
23
- finishSong: [queue: Queue, song: Song];
16
+ deleteQueue: [queue: Queue];
17
+ disconnect: [queue: Queue];
24
18
  empty: [queue: Queue];
19
+ error: [channel: GuildTextBasedChannel | undefined, error: Error];
20
+ ffmpegDebug: [debug: string];
25
21
  finish: [queue: Queue];
22
+ finishSong: [queue: Queue, song: Song];
26
23
  initQueue: [queue: Queue];
27
24
  noRelated: [queue: Queue];
28
- disconnect: [queue: Queue];
29
- deleteQueue: [queue: Queue];
25
+ playSong: [queue: Queue, song: Song];
30
26
  searchCancel: [message: Message<true>, query: string];
31
- searchNoResult: [message: Message<true>, query: string];
32
27
  searchDone: [message: Message<true>, answer: Message<true>, query: string];
33
28
  searchInvalidAnswer: [message: Message<true>, answer: Message<true>, query: string];
29
+ searchNoResult: [message: Message<true>, query: string];
34
30
  searchResult: [message: Message<true>, results: SearchResult[], query: string];
35
31
  };
36
32
  type TypedDisTubeEvents = {
37
33
  [K in keyof DisTubeEvents]: (...args: DisTubeEvents[K]) => Awaitable;
38
34
  };
35
+ type DisTubeVoiceEvents = {
36
+ disconnect: (error?: Error) => Awaitable;
37
+ error: (error: Error) => Awaitable;
38
+ finish: () => Awaitable;
39
+ };
39
40
  /**
40
41
  * An FFmpeg audio filter object
41
- * ```
42
+ *
43
+ * ```ts
42
44
  * {
43
45
  * name: "bassboost",
44
46
  * value: "bass=g=10"
45
47
  * }
46
- * ```
47
- * @typedef {Object} Filter
48
- * @prop {string} name Name of the filter
49
- * @prop {string} value FFmpeg audio filter(s)
48
+ * ```ts
50
49
  */
51
50
  interface Filter {
51
+ /**
52
+ * Name of the filter
53
+ */
52
54
  name: string;
55
+ /**
56
+ * FFmpeg audio filter argument
57
+ */
53
58
  value: string;
54
59
  }
55
60
  /**
56
61
  * Data that resolves to give an FFmpeg audio filter. This can be:
62
+ *
57
63
  * - A name of a default filters or custom filters (`string`)
58
64
  * - A {@link Filter} object
59
- * @typedef {string|Filter} FilterResolvable
65
+ *
60
66
  * @see {@link defaultFilters}
61
67
  * @see {@link DisTubeOptions|DisTubeOptions.customFilters}
62
68
  */
63
69
  type FilterResolvable = string | Filter;
64
70
  /**
65
71
  * FFmpeg Filters
66
- * ```
72
+ *
73
+ * ```ts
67
74
  * {
68
75
  * "Filter Name": "Filter Value",
69
76
  * "bassboost": "bass=g=10"
70
77
  * }
71
- * ```
72
- * @typedef {Object.<string, string>} Filters
78
+ * ```ts
79
+ *
73
80
  * @see {@link defaultFilters}
74
81
  */
75
82
  type Filters = Record<string, string>;
76
83
  /**
77
- * DisTube options.
78
- * @typedef {Object} DisTubeOptions
79
- * @prop {Array<CustomPlugin|ExtractorPlugin>} [plugins] DisTube plugins.
80
- * @prop {boolean} [emitNewSongOnly=false] Whether or not emitting {@link DisTube#event:playSong} event
81
- * when looping a song or next song is the same as the previous one
82
- * @prop {boolean} [leaveOnEmpty=true] Whether or not leaving voice channel
83
- * if the voice channel is empty after {@link DisTubeOptions}.emptyCooldown seconds.
84
- * @prop {boolean} [leaveOnFinish=false] Whether or not leaving voice channel when the queue ends.
85
- * @prop {boolean} [leaveOnStop=true] Whether or not leaving voice channel after using {@link DisTube#stop} function.
86
- * @prop {boolean} [savePreviousSongs=true] Whether or not saving the previous songs of the queue
87
- * and enable {@link DisTube#previous} method
88
- * @prop {number} [searchSongs=0] Limit of search results emits in {@link DisTube#event:searchResult} event
89
- * when {@link DisTube#play} method executed. If `searchSongs <= 1`, play the first result
90
- * @prop {Cookie[]|string} [youtubeCookie] YouTube cookies. Guide: {@link https://distube.js.org/#/docs/DisTube/main/general/cookie YouTube Cookies}
91
- * @prop {Filters} [customFilters] Override {@link defaultFilters} or add more ffmpeg filters.
92
- * @prop {ytdl.getInfoOptions} [ytdlOptions] `ytdl-core` get info options
93
- * @prop {number} [searchCooldown=60] Built-in search cooldown in seconds (When searchSongs is bigger than 0)
94
- * @prop {number} [emptyCooldown=60] Built-in leave on empty cooldown in seconds (When leaveOnEmpty is true)
95
- * @prop {boolean} [nsfw=false] Whether or not playing age-restricted content
96
- * and disabling safe search in non-NSFW channel.
97
- * @prop {boolean} [emitAddListWhenCreatingQueue=true] Whether or not emitting `addList` event when creating a new Queue
98
- * @prop {boolean} [emitAddSongWhenCreatingQueue=true] Whether or not emitting `addSong` event when creating a new Queue
99
- * @prop {boolean} [joinNewVoiceChannel=true] Whether or not joining the new voice channel
100
- * when using {@link DisTube#play} method
101
- * @prop {StreamType} [streamType=StreamType.OPUS] Decide the {@link DisTubeStream#type} will be used
102
- * (Not the same as {@link DisTubeStream#type})
103
- * @prop {boolean} [directLink=true] Whether or not playing a song with direct link
84
+ * DisTube options
104
85
  */
105
86
  type DisTubeOptions = {
87
+ /**
88
+ * DisTube plugins
89
+ */
106
90
  plugins?: (CustomPlugin | ExtractorPlugin)[];
91
+ /**
92
+ * Whether or not emitting {@link DisTube#playSong} event when looping a song
93
+ * or next song is the same as the previous one
94
+ */
107
95
  emitNewSongOnly?: boolean;
96
+ /**
97
+ * Whether or not leaving voice channel if the voice channel is empty after {@link
98
+ * DisTubeOptions}.emptyCooldown seconds
99
+ */
100
+ leaveOnEmpty?: boolean;
101
+ /**
102
+ * Whether or not leaving voice channel when the queue ends
103
+ */
108
104
  leaveOnFinish?: boolean;
105
+ /**
106
+ * Whether or not leaving voice channel after using {@link DisTube#stop} function
107
+ */
109
108
  leaveOnStop?: boolean;
110
- leaveOnEmpty?: boolean;
109
+ /**
110
+ * Built-in leave on empty cooldown in seconds (When leaveOnEmpty is true)
111
+ */
111
112
  emptyCooldown?: number;
113
+ /**
114
+ * Whether or not saving the previous songs of the queue and enable {@link
115
+ * DisTube#previous} method
116
+ */
112
117
  savePreviousSongs?: boolean;
118
+ /**
119
+ * Limit of search results emits in {@link DisTube#searchResult} event when
120
+ * {@link DisTube#play} method executed. If `searchSongs <= 1`, play the first
121
+ * result
122
+ */
113
123
  searchSongs?: number;
124
+ /**
125
+ * Built-in search cooldown in seconds (When searchSongs is bigger than 0)
126
+ */
114
127
  searchCooldown?: number;
128
+ /**
129
+ * YouTube cookies. Guide: {@link
130
+ * https://github.com/skick1234/DisTube/wiki/YouTube-Cookies | YouTube Cookies}
131
+ */
115
132
  youtubeCookie?: Cookie[] | string;
133
+ /**
134
+ * Override {@link defaultFilters} or add more ffmpeg filters
135
+ */
116
136
  customFilters?: Filters;
137
+ /**
138
+ * `ytdl-core` get info options
139
+ */
117
140
  ytdlOptions?: ytdl__default.downloadOptions;
141
+ /**
142
+ * Whether or not playing age-restricted content and disabling safe search in
143
+ * non-NSFW channel
144
+ */
118
145
  nsfw?: boolean;
146
+ /**
147
+ * Whether or not emitting `addSong` event when creating a new Queue
148
+ */
119
149
  emitAddSongWhenCreatingQueue?: boolean;
150
+ /**
151
+ * Whether or not emitting `addList` event when creating a new Queue
152
+ */
120
153
  emitAddListWhenCreatingQueue?: boolean;
154
+ /**
155
+ * Whether or not joining the new voice channel when using {@link DisTube#play}
156
+ * method
157
+ */
121
158
  joinNewVoiceChannel?: boolean;
159
+ /**
160
+ * Decide the {@link DisTubeStream#type} will be used (Not the same as {@link
161
+ * DisTubeStream#type})
162
+ */
122
163
  streamType?: StreamType;
164
+ /**
165
+ * Whether or not playing a song with direct link
166
+ */
123
167
  directLink?: boolean;
168
+ /**
169
+ * FFmpeg path
170
+ * @deprecated
171
+ */
172
+ ffmpegPath?: string;
173
+ /**
174
+ * FFmpeg default arguments
175
+ * @deprecated
176
+ */
177
+ ffmpegDefaultArgs?: FFmpegArgs;
178
+ /**
179
+ * FFmpeg options
180
+ */
181
+ ffmpeg?: {
182
+ /**
183
+ * FFmpeg path
184
+ */
185
+ path?: string;
186
+ /**
187
+ * FFmpeg default arguments
188
+ */
189
+ args?: {
190
+ global?: FFmpegArgs;
191
+ input?: FFmpegArgs;
192
+ output?: FFmpegArgs;
193
+ };
194
+ };
124
195
  };
125
196
  /**
126
197
  * Data that can be resolved to give a guild id string. This can be:
198
+ *
127
199
  * - A guild id string | a guild {@link https://discord.js.org/#/docs/main/stable/class/Snowflake|Snowflake}
128
- * - A {@link https://discord.js.org/#/docs/main/stable/class/Guild|Guild}
129
- * - A {@link https://discord.js.org/#/docs/main/stable/class/Message|Message}
130
- * - A {@link https://discord.js.org/#/docs/main/stable/class/BaseGuildVoiceChannel|BaseGuildVoiceChannel}
131
- * - A {@link https://discord.js.org/#/docs/main/stable/class/BaseGuildTextChannel|BaseGuildTextChannel}
132
- * - A {@link https://discord.js.org/#/docs/main/stable/class/VoiceState|VoiceState}
133
- * - A {@link https://discord.js.org/#/docs/main/stable/class/GuildMember|GuildMember}
134
- * - A {@link https://discord.js.org/#/docs/main/stable/class/Interaction|Interaction}
200
+ * - A {@link https://discord.js.org/#/docs/main/stable/class/Guild | Guild}
201
+ * - A {@link https://discord.js.org/#/docs/main/stable/class/Message | Message}
202
+ * - A {@link https://discord.js.org/#/docs/main/stable/class/BaseGuildVoiceChannel
203
+ * | BaseGuildVoiceChannel}
204
+ * - A {@link https://discord.js.org/#/docs/main/stable/class/BaseGuildTextChannel
205
+ * | BaseGuildTextChannel}
206
+ * - A {@link https://discord.js.org/#/docs/main/stable/class/VoiceState |
207
+ * VoiceState}
208
+ * - A {@link https://discord.js.org/#/docs/main/stable/class/GuildMember |
209
+ * GuildMember}
210
+ * - A {@link https://discord.js.org/#/docs/main/stable/class/Interaction |
211
+ * Interaction}
135
212
  * - A {@link DisTubeVoice}
136
213
  * - A {@link Queue}
137
- * @typedef {
138
- * Discord.Snowflake|
139
- * Discord.Guild|
140
- * Discord.Message|
141
- * Discord.BaseGuildVoiceChannel|
142
- * Discord.BaseGuildTextChannel|
143
- * Discord.VoiceState|
144
- * Discord.GuildMember|
145
- * Discord.Interaction|
146
- * DisTubeVoice|
147
- * Queue|
148
- * string
149
- * } GuildIdResolvable
150
214
  */
151
215
  type GuildIdResolvable = Queue | DisTubeVoice | Snowflake | Message | GuildTextBasedChannel | VoiceBasedChannel | VoiceState | Guild | GuildMember | Interaction | string;
152
216
  interface OtherSongInfo {
@@ -190,76 +254,80 @@ interface PlaylistInfo {
190
254
  name?: string;
191
255
  url?: string;
192
256
  thumbnail?: string;
193
- /** @deprecated */
257
+ /**
258
+ * @deprecated Use {@link PlaylistInfo#name}
259
+ */
194
260
  title?: string;
195
- /** @deprecated */
261
+ /**
262
+ * @deprecated Use {@link PlaylistInfo#url}
263
+ */
196
264
  webpage_url?: string;
197
265
  }
198
266
  type RelatedSong = Omit<Song, "related">;
199
- /**
200
- * @typedef {Object} PlayHandlerOptions
201
- * @prop {Discord.BaseGuildTextChannel} [options.textChannel] The default text channel of the queue
202
- * @prop {boolean} [options.skip=false] Skip the playing song (if exists) and play the added playlist instantly
203
- * @prop {number} [options.position=0] Position of the song/playlist to add to the queue,
204
- * <= 0 to add to the end of the queue.
205
- */
206
267
  type PlayHandlerOptions = {
268
+ /**
269
+ * [Default: false] Skip the playing song (if exists) and play the added playlist
270
+ * instantly
271
+ */
207
272
  skip?: boolean;
273
+ /**
274
+ * [Default: 0] Position of the song/playlist to add to the queue, \<= 0 to add to
275
+ * the end of the queue
276
+ */
208
277
  position?: number;
278
+ /**
279
+ * The default text channel of the queue
280
+ */
209
281
  textChannel?: GuildTextBasedChannel;
210
282
  };
211
- /**
212
- * @typedef {Object} PlayOptions
213
- * @prop {Discord.GuildMember} [member] Requested user (default is your bot)
214
- * @prop {Discord.BaseGuildTextChannel} [textChannel] Default {@link Queue#textChannel}
215
- * @prop {boolean} [skip=false]
216
- * Skip the playing song (if exists) and play the added song/playlist if `position` is 1.
217
- * If `position` is defined and not equal to 1, it will skip to the next song instead of the added song
218
- * @prop {number} [position=0] Position of the song/playlist to add to the queue,
219
- * <= 0 to add to the end of the queue.
220
- * @prop {Discord.Message} [message] Called message (For built-in search events. If this is a {@link https://developer.mozilla.org/en-US/docs/Glossary/Falsy|falsy value}, it will play the first result instead)
221
- * @prop {*} [metadata] Optional metadata that can be attached to the song/playlist will be played,
222
- * This is useful for identification purposes when the song/playlist is passed around in events.
223
- * See {@link Song#metadata} or {@link Playlist#metadata}
224
- */
225
283
  interface PlayOptions extends PlayHandlerOptions, ResolveOptions<any> {
284
+ /**
285
+ * Called message (For built-in search events. If this is a {@link
286
+ * https://developer.mozilla.org/en-US/docs/Glossary/Falsy | falsy value}, it will
287
+ * play the first result instead)
288
+ */
226
289
  message?: Message;
227
290
  }
228
- /**
229
- * @typedef {Object} ResolveOptions
230
- * @prop {Discord.GuildMember} [member] Requested user
231
- * @prop {*} [metadata] Metadata
232
- */
233
291
  interface ResolveOptions<T = unknown> {
292
+ /**
293
+ * Requested user
294
+ */
234
295
  member?: GuildMember;
296
+ /**
297
+ * Metadata
298
+ */
235
299
  metadata?: T;
236
300
  }
237
- /**
238
- * @typedef {ResolveOptions} ResolvePlaylistOptions
239
- * @prop {string} [source] Source of the playlist
240
- */
241
301
  interface ResolvePlaylistOptions<T = unknown> extends ResolveOptions<T> {
302
+ /**
303
+ * Source of the playlist
304
+ */
242
305
  source?: string;
243
306
  }
244
- /**
245
- * @typedef {Object} CustomPlaylistOptions
246
- * @prop {Discord.GuildMember} [member] A guild member creating the playlist
247
- * @prop {Object} [properties] Additional properties such as `name`
248
- * @prop {boolean} [parallel=true] Whether or not fetch the songs in parallel
249
- * @prop {*} [metadata] Metadata
250
- */
251
307
  interface CustomPlaylistOptions {
308
+ /**
309
+ * A guild member creating the playlist
310
+ */
252
311
  member?: GuildMember;
312
+ /**
313
+ * Additional properties such as `name`
314
+ */
253
315
  properties?: Record<string, any>;
316
+ /**
317
+ * Whether or not fetch the songs in parallel
318
+ */
254
319
  parallel?: boolean;
320
+ /**
321
+ * Metadata
322
+ */
255
323
  metadata?: any;
256
324
  }
257
325
  /**
258
326
  * The repeat mode of a {@link Queue}
259
- * * `DISABLED` = 0
260
- * * `SONG` = 1
261
- * * `QUEUE` = 2
262
- * @typedef {number} RepeatMode
327
+ *
328
+ * - `DISABLED` = 0
329
+ * - `SONG` = 1
330
+ * - `QUEUE` = 2
263
331
  */
264
332
  declare enum RepeatMode {
265
333
  DISABLED = 0,
@@ -268,9 +336,9 @@ declare enum RepeatMode {
268
336
  }
269
337
  /**
270
338
  * All available plugin types:
271
- * * `CUSTOM` = `"custom"`: {@link CustomPlugin}
272
- * * `EXTRACTOR` = `"extractor"`: {@link ExtractorPlugin}
273
- * @typedef {"custom"|"extractor"} PluginType
339
+ *
340
+ * - `CUSTOM` = `"custom"`: {@link CustomPlugin}
341
+ * - `EXTRACTOR` = `"extractor"`: {@link ExtractorPlugin}
274
342
  */
275
343
  declare enum PluginType {
276
344
  CUSTOM = "custom",
@@ -278,9 +346,9 @@ declare enum PluginType {
278
346
  }
279
347
  /**
280
348
  * Search result types:
281
- * * `VIDEO` = `"video"`
282
- * * `PLAYLIST` = `"playlist"`
283
- * @typedef {"video"|"playlist"} SearchResultType
349
+ *
350
+ * - `VIDEO` = `"video"`
351
+ * - `PLAYLIST` = `"playlist"`
284
352
  */
285
353
  declare enum SearchResultType {
286
354
  VIDEO = "video",
@@ -288,34 +356,14 @@ declare enum SearchResultType {
288
356
  }
289
357
  /**
290
358
  * Stream types:
291
- * * `OPUS` = `0` (Better quality, use more resources - **Recommended**)
292
- * * `RAW` = `1` (Better performance, use less resources)
293
- * @typedef {number} StreamType
294
- * @type {StreamType}
359
+ *
360
+ * - `OPUS` = `0` (Better quality, use more resources - **Recommended**)
361
+ * - `RAW` = `1` (Better performance, use less resources)
295
362
  */
296
363
  declare enum StreamType {
297
364
  OPUS = 0,
298
365
  RAW = 1
299
366
  }
300
- /**
301
- * @typedef {Object} Events
302
- * @prop {string} ERROR error
303
- * @prop {string} ADD_LIST addList
304
- * @prop {string} ADD_SONG addSong
305
- * @prop {string} PLAY_SONG playSong
306
- * @prop {string} FINISH_SONG finishSong
307
- * @prop {string} EMPTY empty
308
- * @prop {string} FINISH finish
309
- * @prop {string} INIT_QUEUE initQueue
310
- * @prop {string} NO_RELATED noRelated
311
- * @prop {string} DISCONNECT disconnect
312
- * @prop {string} DELETE_QUEUE deleteQueue
313
- * @prop {string} SEARCH_CANCEL searchCancel
314
- * @prop {string} SEARCH_NO_RESULT searchNoResult
315
- * @prop {string} SEARCH_DONE searchDone
316
- * @prop {string} SEARCH_INVALID_ANSWER searchInvalidAnswer
317
- * @prop {string} SEARCH_RESULT searchResult
318
- */
319
367
  declare enum Events {
320
368
  ERROR = "error",
321
369
  ADD_LIST = "addList",
@@ -332,46 +380,40 @@ declare enum Events {
332
380
  SEARCH_NO_RESULT = "searchNoResult",
333
381
  SEARCH_DONE = "searchDone",
334
382
  SEARCH_INVALID_ANSWER = "searchInvalidAnswer",
335
- SEARCH_RESULT = "searchResult"
383
+ SEARCH_RESULT = "searchResult",
384
+ FFMPEG_DEBUG = "ffmpegDebug"
336
385
  }
386
+ type FFmpegArgs = Record<string, string | number | boolean | Array<string | null | undefined> | null | undefined>;
387
+ type FFmpegOptions = {
388
+ path: string;
389
+ args: {
390
+ global: FFmpegArgs;
391
+ input: FFmpegArgs;
392
+ output: FFmpegArgs;
393
+ };
394
+ };
337
395
 
338
396
  /**
339
397
  * Default DisTube audio filters.
340
- * @typedef {Object} defaultFilters
341
- * @prop {string} 3d 3d
342
- * @prop {string} bassboost bassboost
343
- * @prop {string} echo echo
344
- * @prop {string} karaoke karaoke
345
- * @prop {string} nightcore nightcore
346
- * @prop {string} vaporwave vaporwave
347
- * @prop {string} flanger flanger
348
- * @prop {string} gate gate
349
- * @prop {string} haas haas
350
- * @prop {string} reverse reverse
351
- * @prop {string} surround surround
352
- * @prop {string} mcompand mcompand
353
- * @prop {string} phaser phaser
354
- * @prop {string} tremolo tremolo
355
- * @prop {string} earwax earwax
356
398
  */
357
399
  declare const defaultFilters: Filters;
358
400
  declare const defaultOptions: {
359
401
  plugins: never[];
360
- emitNewSongOnly: boolean;
361
- leaveOnEmpty: boolean;
362
- leaveOnFinish: boolean;
363
- leaveOnStop: boolean;
364
- savePreviousSongs: boolean;
402
+ emitNewSongOnly: false;
403
+ leaveOnEmpty: true;
404
+ leaveOnFinish: false;
405
+ leaveOnStop: true;
406
+ savePreviousSongs: true;
365
407
  searchSongs: number;
366
408
  ytdlOptions: {};
367
409
  searchCooldown: number;
368
410
  emptyCooldown: number;
369
- nsfw: boolean;
370
- emitAddSongWhenCreatingQueue: boolean;
371
- emitAddListWhenCreatingQueue: boolean;
372
- joinNewVoiceChannel: boolean;
373
- streamType: StreamType;
374
- directLink: boolean;
411
+ nsfw: false;
412
+ emitAddSongWhenCreatingQueue: true;
413
+ emitAddListWhenCreatingQueue: true;
414
+ joinNewVoiceChannel: true;
415
+ streamType: StreamType.OPUS;
416
+ directLink: true;
375
417
  };
376
418
 
377
419
  declare const ERROR_MESSAGES: {
@@ -393,6 +435,8 @@ declare const ERROR_MESSAGES: {
393
435
  VOICE_RECONNECT_FAILED: string;
394
436
  VOICE_DIFFERENT_GUILD: string;
395
437
  VOICE_DIFFERENT_CLIENT: string;
438
+ FFMPEG_EXITED: (code: number) => string;
439
+ FFMPEG_NOT_INSTALLED: (path: string) => string;
396
440
  NO_QUEUE: string;
397
441
  QUEUE_EXIST: string;
398
442
  PAUSED: string;
@@ -431,14 +475,13 @@ declare class DisTubeError<T extends string> extends Error {
431
475
 
432
476
  /**
433
477
  * Task queuing system
434
- * @private
435
478
  */
436
479
  declare class TaskQueue {
437
480
  #private;
438
481
  /**
439
482
  * Waits for last task finished and queues a new task
440
- * @param {boolean} [resolveInfo=false] Whether the task is a resolving info task
441
- * @returns {Promise<void>}
483
+ *
484
+ * @param resolveInfo - Whether the task is a resolving info task
442
485
  */
443
486
  queuing(resolveInfo?: boolean): Promise<void>;
444
487
  /**
@@ -447,20 +490,16 @@ declare class TaskQueue {
447
490
  resolve(): void;
448
491
  /**
449
492
  * The remaining number of tasks
450
- * @type {number}
451
493
  */
452
494
  get remaining(): number;
453
495
  /**
454
496
  * Whether or not having a resolving info task
455
- * @type {boolean}
456
497
  */
457
498
  get hasResolveTask(): boolean;
458
499
  }
459
500
 
460
501
  /**
461
502
  * Class representing a playlist.
462
- * @prop {string} source Playlist source
463
- * @template T - The type for the metadata (if any) of the playlist
464
503
  */
465
504
  declare class Playlist<T = unknown> implements PlaylistInfo {
466
505
  #private;
@@ -472,11 +511,9 @@ declare class Playlist<T = unknown> implements PlaylistInfo {
472
511
  [x: string]: any;
473
512
  /**
474
513
  * Create a playlist
475
- * @param {Song[]|PlaylistInfo} playlist Playlist
476
- * @param {Object} [options] Optional options
477
- * @param {Discord.GuildMember} [options.member] Requested user
478
- * @param {Object} [options.properties] Custom properties
479
- * @param {T} [options.metadata] Playlist metadata
514
+ *
515
+ * @param playlist - Playlist
516
+ * @param options - Optional options
480
517
  */
481
518
  constructor(playlist: Song[] | PlaylistInfo, options?: {
482
519
  member?: GuildMember;
@@ -485,23 +522,19 @@ declare class Playlist<T = unknown> implements PlaylistInfo {
485
522
  });
486
523
  /**
487
524
  * Playlist duration in second.
488
- * @type {number}
489
525
  */
490
526
  get duration(): number;
491
527
  /**
492
528
  * Formatted duration string `hh:mm:ss`.
493
- * @type {string}
494
529
  */
495
530
  get formattedDuration(): string;
496
531
  /**
497
532
  * User requested.
498
- * @type {Discord.GuildMember?}
499
533
  */
500
534
  get member(): GuildMember | undefined;
501
535
  set member(member: GuildMember | undefined);
502
536
  /**
503
537
  * User requested.
504
- * @type {Discord.User?}
505
538
  */
506
539
  get user(): discord_js.User | undefined;
507
540
  get metadata(): T;
@@ -510,8 +543,8 @@ declare class Playlist<T = unknown> implements PlaylistInfo {
510
543
 
511
544
  /**
512
545
  * A abstract class representing a search result.
513
- * @abstract
514
- * @private
546
+ *
547
+ * @virtual
515
548
  */
516
549
  declare abstract class ISearchResult {
517
550
  source: "youtube";
@@ -525,13 +558,13 @@ declare abstract class ISearchResult {
525
558
  };
526
559
  /**
527
560
  * Create a search result
528
- * @param {Object} info ytsr result
561
+ *
562
+ * @param info - ytsr result
529
563
  */
530
564
  constructor(info: Video | Playlist$1);
531
565
  }
532
566
  /**
533
567
  * A class representing a video search result.
534
- * @extends ISearchResult
535
568
  */
536
569
  declare class SearchResultVideo extends ISearchResult {
537
570
  type: SearchResultType.VIDEO;
@@ -544,12 +577,10 @@ declare class SearchResultVideo extends ISearchResult {
544
577
  }
545
578
  /**
546
579
  * A video or playlist search result
547
- * @typedef {SearchResultVideo|SearchResultPlaylist} SearchResult
548
580
  */
549
581
  type SearchResult = SearchResultVideo | SearchResultPlaylist;
550
582
  /**
551
583
  * A class representing a playlist search result.
552
- * @extends ISearchResult
553
584
  */
554
585
  declare class SearchResultPlaylist extends ISearchResult {
555
586
  type: SearchResultType.PLAYLIST;
@@ -560,12 +591,12 @@ declare class SearchResultPlaylist extends ISearchResult {
560
591
  /**
561
592
  * Class representing a song.
562
593
  *
563
- * <info>If {@link Song} is added from a YouTube {@link SearchResult} or {@link Playlist},
564
- * some info will be missing to save your resources. It will be filled when emitting {@link DisTube#playSong} event.
594
+ * <info>If {@link Song} is added from a YouTube {@link SearchResult} or {@link
595
+ * Playlist}, some info will be missing to save your resources. It will be filled
596
+ * when emitting {@link DisTube#playSong} event.
565
597
  *
566
598
  * Missing info: {@link Song#likes}, {@link Song#dislikes}, {@link Song#streamURL},
567
599
  * {@link Song#related}, {@link Song#chapters}, {@link Song#age_restricted}</info>
568
- * @template T - The type for the metadata (if any) of the song
569
600
  */
570
601
  declare class Song<T = unknown> {
571
602
  #private;
@@ -592,11 +623,9 @@ declare class Song<T = unknown> {
592
623
  reposts: number;
593
624
  /**
594
625
  * Create a Song
595
- * @param {ytdl.videoInfo|SearchResult|OtherSongInfo} info Raw info
596
- * @param {Object} [options] Optional options
597
- * @param {Discord.GuildMember} [options.member] Requested user
598
- * @param {string} [options.source="youtube"] Song source
599
- * @param {T} [options.metadata] Song metadata
626
+ *
627
+ * @param info - Raw info
628
+ * @param options - Optional options
600
629
  */
601
630
  constructor(info: ytdl__default.videoInfo | SearchResult | OtherSongInfo | ytdl__default.relatedVideo | RelatedSong | ytpl.result["items"][number], options?: {
602
631
  member?: GuildMember;
@@ -606,25 +635,22 @@ declare class Song<T = unknown> {
606
635
  _patchYouTube(i: ytdl__default.videoInfo | SearchResult): void;
607
636
  /**
608
637
  * Patch data from other source
609
- * @param {OtherSongInfo} info Video info
610
- * @private
638
+ *
639
+ * @param info - Video info
611
640
  */
612
641
  _patchOther(info: OtherSongInfo): void;
613
642
  /**
614
643
  * The playlist added this song
615
- * @type {Playlist?}
616
644
  */
617
645
  get playlist(): Playlist | undefined;
618
646
  set playlist(playlist: Playlist | undefined);
619
647
  /**
620
648
  * User requested.
621
- * @type {Discord.GuildMember?}
622
649
  */
623
650
  get member(): GuildMember | undefined;
624
651
  set member(member: GuildMember | undefined);
625
652
  /**
626
653
  * User requested.
627
- * @type {Discord.User?}
628
654
  */
629
655
  get user(): discord_js.User | undefined;
630
656
  get metadata(): T;
@@ -632,53 +658,43 @@ declare class Song<T = unknown> {
632
658
  }
633
659
 
634
660
  /**
635
- * @private
636
- * @abstract
661
+ * @virtual
637
662
  */
638
663
  declare abstract class DisTubeBase {
639
664
  distube: DisTube;
640
665
  constructor(distube: DisTube);
641
666
  /**
642
667
  * Emit the {@link DisTube} of this base
643
- * @param {string} eventName Event name
644
- * @param {...any} args arguments
645
- * @returns {boolean}
668
+ *
669
+ * @param eventName - Event name
670
+ * @param args - arguments
646
671
  */
647
672
  emit(eventName: keyof DisTubeEvents, ...args: any): boolean;
648
673
  /**
649
674
  * Emit error event
650
- * @param {Error} error error
651
- * @param {Discord.BaseGuildTextChannel} [channel] Text channel where the error is encountered.
675
+ *
676
+ * @param error - error
677
+ * @param channel - Text channel where the error is encountered.
652
678
  */
653
679
  emitError(error: Error, channel?: GuildTextBasedChannel): void;
654
680
  /**
655
681
  * The queue manager
656
- * @type {QueueManager}
657
- * @readonly
658
682
  */
659
683
  get queues(): QueueManager;
660
684
  /**
661
685
  * The voice manager
662
- * @type {DisTubeVoiceManager}
663
- * @readonly
664
686
  */
665
687
  get voices(): DisTubeVoiceManager;
666
688
  /**
667
689
  * Discord.js client
668
- * @type {Discord.Client}
669
- * @readonly
670
690
  */
671
691
  get client(): Client;
672
692
  /**
673
693
  * DisTube options
674
- * @type {DisTubeOptions}
675
- * @readonly
676
694
  */
677
695
  get options(): Options;
678
696
  /**
679
697
  * DisTube handler
680
- * @type {DisTubeHandler}
681
- * @readonly
682
698
  */
683
699
  get handler(): DisTubeHandler;
684
700
  }
@@ -695,119 +711,123 @@ declare class DisTubeVoice extends TypedEmitter<DisTubeVoiceEvents> {
695
711
  audioResource?: AudioResource;
696
712
  emittedError: boolean;
697
713
  isDisconnected: boolean;
714
+ stream?: DisTubeStream;
698
715
  constructor(voiceManager: DisTubeVoiceManager, channel: VoiceBasedChannel);
699
716
  /**
700
717
  * The voice channel id the bot is in
701
- * @type {Snowflake?}
702
718
  */
703
719
  get channelId(): string | undefined;
704
720
  get channel(): VoiceBasedChannel;
705
721
  set channel(channel: VoiceBasedChannel);
706
722
  /**
707
723
  * Join a voice channel with this connection
708
- * @param {Discord.BaseGuildVoiceChannel} [channel] A voice channel
709
- * @returns {Promise<DisTubeVoice>}
724
+ *
725
+ * @param channel - A voice channel
710
726
  */
711
727
  join(channel?: VoiceBasedChannel): Promise<DisTubeVoice>;
712
728
  /**
713
729
  * Leave the voice channel of this connection
714
- * @param {Error} [error] Optional, an error to emit with 'error' event.
730
+ *
731
+ * @param error - Optional, an error to emit with 'error' event.
715
732
  */
716
733
  leave(error?: Error): void;
717
734
  /**
718
735
  * Stop the playing stream
719
- * @param {boolean} [force=false] If true, will force the {@link DisTubeVoice#audioPlayer} to enter the Idle state
720
- * even if the {@link DisTubeVoice#audioResource} has silence padding frames.
721
- * @private
736
+ *
737
+ * @param force - If true, will force the {@link DisTubeVoice#audioPlayer} to enter the Idle state even
738
+ * if the {@link DisTubeVoice#audioResource} has silence padding frames.
722
739
  */
723
740
  stop(force?: boolean): void;
724
741
  /**
725
- * Play a readable stream
726
- * @private
727
- * @param {DisTubeStream} stream Readable stream
742
+ * Play a {@link DisTubeStream}
743
+ *
744
+ * @param dtStream - DisTubeStream
728
745
  */
729
- play(stream: DisTubeStream): void;
746
+ play(dtStream: DisTubeStream): void;
730
747
  set volume(volume: number);
731
748
  get volume(): number;
732
749
  /**
733
750
  * Playback duration of the audio resource in seconds
734
- * @type {number}
735
751
  */
736
752
  get playbackDuration(): number;
737
753
  pause(): void;
738
754
  unpause(): void;
739
755
  /**
740
756
  * Whether the bot is self-deafened
741
- * @type {boolean}
742
757
  */
743
758
  get selfDeaf(): boolean;
744
759
  /**
745
760
  * Whether the bot is self-muted
746
- * @type {boolean}
747
761
  */
748
762
  get selfMute(): boolean;
749
763
  /**
750
764
  * Self-deafens/undeafens the bot.
751
- * @param {boolean} selfDeaf Whether or not the bot should be self-deafened
752
- * @returns {boolean} true if the voice state was successfully updated, otherwise false
765
+ *
766
+ * @param selfDeaf - Whether or not the bot should be self-deafened
767
+ *
768
+ * @returns true if the voice state was successfully updated, otherwise false
753
769
  */
754
770
  setSelfDeaf(selfDeaf: boolean): boolean;
755
771
  /**
756
772
  * Self-mutes/unmutes the bot.
757
- * @param {boolean} selfMute Whether or not the bot should be self-muted
758
- * @returns {boolean} true if the voice state was successfully updated, otherwise false
773
+ *
774
+ * @param selfMute - Whether or not the bot should be self-muted
775
+ *
776
+ * @returns true if the voice state was successfully updated, otherwise false
759
777
  */
760
778
  setSelfMute(selfMute: boolean): boolean;
761
779
  /**
762
780
  * The voice state of this connection
763
- * @type {Discord.VoiceState?}
764
781
  */
765
782
  get voiceState(): VoiceState | undefined;
766
783
  }
767
784
 
768
785
  interface StreamOptions {
786
+ ffmpeg: FFmpegOptions;
769
787
  seek?: number;
770
- ffmpegArgs?: string[];
771
788
  type?: StreamType;
772
789
  }
773
790
  declare const chooseBestVideoFormat: ({ duration, formats, isLive }: Song) => ytdl.videoFormat | undefined;
791
+ declare const checkFFmpeg: (distube: DisTube) => void;
774
792
  /**
775
793
  * Create a stream to play with {@link DisTubeVoice}
776
- * @private
777
794
  */
778
- declare class DisTubeStream {
795
+ declare class DisTubeStream extends TypedEmitter<{
796
+ debug: (debug: string) => Awaitable;
797
+ error: (error: Error) => Awaitable;
798
+ }> {
799
+ private killed;
800
+ process: ChildProcess;
801
+ stream: PassThrough;
802
+ type: StreamType$1;
803
+ url: string;
779
804
  /**
780
- * Create a stream from ytdl video formats
781
- * @param {Song} song A YouTube Song
782
- * @param {StreamOptions} options options
783
- * @returns {DisTubeStream}
784
- * @private
805
+ * Create a DisTubeStream to play with {@link DisTubeVoice}
806
+ *
807
+ * @param url - Stream URL
808
+ * @param options - Stream options
785
809
  */
786
- static YouTube(song: Song, options?: StreamOptions): DisTubeStream;
810
+ constructor(url: string, { ffmpeg, seek, type }: StreamOptions);
811
+ private debug;
812
+ kill(): void;
787
813
  /**
788
- * Create a stream from a stream url
789
- * @param {string} url stream url
790
- * @param {StreamOptions} options options
791
- * @returns {DisTubeStream}
792
- * @private
814
+ * Create a stream from a YouTube {@link Song}
815
+ *
816
+ * @param song - A YouTube Song
817
+ * @param options - options
793
818
  */
794
- static DirectLink(url: string, options?: StreamOptions): DisTubeStream;
795
- type: StreamType$1;
796
- stream: FFmpeg;
797
- url: string;
819
+ static YouTube(song: Song, options: StreamOptions): DisTubeStream;
798
820
  /**
799
- * Create a DisTubeStream to play with {@link DisTubeVoice}
800
- * @param {string} url Stream URL
801
- * @param {StreamOptions} options Stream options
802
- * @private
821
+ * Create a stream from a stream url
822
+ *
823
+ * @param url - stream url
824
+ * @param options - options
803
825
  */
804
- constructor(url: string, options: StreamOptions);
826
+ static DirectLink(url: string, options: StreamOptions): DisTubeStream;
805
827
  }
806
828
 
807
829
  /**
808
830
  * DisTube's Handler
809
- * @extends DisTubeBase
810
- * @private
811
831
  */
812
832
  declare class DisTubeHandler extends DisTubeBase {
813
833
  #private;
@@ -815,9 +835,8 @@ declare class DisTubeHandler extends DisTubeBase {
815
835
  get ytdlOptions(): ytdl__default.getInfoOptions;
816
836
  get ytCookie(): string;
817
837
  /**
818
- * @param {string} url url
819
- * @param {boolean} [basic=false] getBasicInfo?
820
- * @returns {Promise<ytdl.videoInfo>}
838
+ * @param url - url
839
+ * @param basic - getBasicInfo?
821
840
  */
822
841
  getYouTubeInfo(url: string, basic?: boolean): Promise<ytdl__default.videoInfo>;
823
842
  resolve<T = unknown>(song: Song<T>, options?: Omit<ResolveOptions, "metadata">): Promise<Song<T>>;
@@ -830,46 +849,55 @@ declare class DisTubeHandler extends DisTubeBase {
830
849
  resolvePlaylist<T = undefined>(playlist: Playlist | Song[] | string, options: ResolvePlaylistOptions<T>): Promise<Playlist<T>>;
831
850
  resolvePlaylist(playlist: Playlist | Song[] | string, options?: ResolvePlaylistOptions): Promise<Playlist>;
832
851
  /**
833
- * Search for a song, fire {@link DisTube#event:error} if not found.
834
- * @param {Discord.Message} message The original message from an user
835
- * @param {string} query The query string
836
- * @returns {Promise<SearchResult?>} Song info
837
- * @throws {DisTubeError}
852
+ * Search for a song, fire {@link DisTube#error} if not found.
853
+ *
854
+ * @throws {@link DisTubeError}
855
+ *
856
+ * @param message - The original message from an user
857
+ * @param query - The query string
858
+ *
859
+ * @returns Song info
838
860
  */
839
861
  searchSong(message: Message<true>, query: string): Promise<SearchResult | null>;
840
862
  /**
841
863
  * Create a message collector for selecting search results.
842
864
  *
843
- * Needed events: {@link DisTube#event:searchResult}, {@link DisTube#event:searchCancel},
844
- * {@link DisTube#event:searchInvalidAnswer}, {@link DisTube#event:searchDone}.
845
- * @param {Discord.Message} message The original message from an user
846
- * @param {Array<SearchResult|Song|Playlist>} results The search results
847
- * @param {string?} [query] The query string
848
- * @returns {Promise<SearchResult|Song|Playlist|null>} Selected result
849
- * @throws {DisTubeError}
865
+ * Needed events: {@link DisTube#searchResult}, {@link DisTube#searchCancel},
866
+ * {@link DisTube#searchInvalidAnswer}, {@link DisTube#searchDone}.
867
+ *
868
+ * @throws {@link DisTubeError}
869
+ *
870
+ * @param message - The original message from an user
871
+ * @param results - The search results
872
+ * @param query - The query string
873
+ *
874
+ * @returns Selected result
850
875
  */
851
876
  createSearchMessageCollector<R extends SearchResult | Song | Playlist>(message: Message<true>, results: Array<R>, query?: string): Promise<R | null>;
852
877
  /**
853
878
  * Play or add a {@link Playlist} to the queue.
854
- * @param {Discord.BaseGuildVoiceChannel} voiceChannel A voice channel
855
- * @param {Playlist|string} playlist A YouTube playlist url | a Playlist
856
- * @param {PlayHandlerOptions} [options] Optional options
857
- * @returns {Promise<void>}
858
- * @throws {DisTubeError}
879
+ *
880
+ * @throws {@link DisTubeError}
881
+ *
882
+ * @param voiceChannel - A voice channel
883
+ * @param playlist - A YouTube playlist url | a Playlist
884
+ * @param options - Optional options
859
885
  */
860
886
  playPlaylist(voiceChannel: VoiceBasedChannel, playlist: Playlist, options?: PlayHandlerOptions): Promise<void>;
861
887
  /**
862
888
  * Play or add a {@link Song} to the queue.
863
- * @param {Discord.BaseGuildVoiceChannel} voiceChannel A voice channel
864
- * @param {Song} song A YouTube playlist url | a Playlist
865
- * @param {PlayHandlerOptions} [options] Optional options
866
- * @returns {Promise<void>}
867
- * @throws {DisTubeError}
889
+ *
890
+ * @throws {@link DisTubeError}
891
+ *
892
+ * @param voiceChannel - A voice channel
893
+ * @param song - A YouTube playlist url | a Playlist
894
+ * @param options - Optional options
868
895
  */
869
896
  playSong(voiceChannel: VoiceBasedChannel, song: Song, options?: PlayHandlerOptions): Promise<void>;
870
897
  /**
871
898
  * Get {@link Song}'s stream info and attach it to the song.
872
- * @param {Song} song A Song
899
+ *
900
+ * @param song - A Song
873
901
  */
874
902
  attachStreamInfo(song: Song): Promise<void>;
875
903
  }
@@ -894,37 +922,37 @@ declare class Options {
894
922
  joinNewVoiceChannel: boolean;
895
923
  streamType: StreamType;
896
924
  directLink: boolean;
925
+ /** @deprecated */
926
+ ffmpegPath: undefined;
927
+ /** @deprecated */
928
+ ffmpegDefaultArgs: undefined;
929
+ ffmpeg: FFmpegOptions;
897
930
  constructor(options: DisTubeOptions);
898
931
  }
899
932
 
900
933
  /**
901
934
  * Manages the collection of a data model.
902
- * @abstract
903
- * @private
904
- * @extends DisTubeBase
935
+ *
936
+ * @virtual
905
937
  */
906
938
  declare abstract class BaseManager<V> extends DisTubeBase {
907
939
  /**
908
940
  * The collection of items for this manager.
909
- * @type {Collection}
910
- * @name BaseManager#collection
911
941
  */
912
942
  collection: Collection<string, V>;
913
943
  /**
914
944
  * The size of the collection.
915
- * @type {number}
916
945
  */
917
946
  get size(): number;
918
947
  }
919
948
 
920
949
  /**
921
950
  * Manages the collection of a data model paired with a guild id.
922
- * @abstract
923
- * @private
924
- * @extends BaseManager
951
+ *
952
+ * @virtual
925
953
  */
926
954
  declare abstract class GuildIdManager<V> extends BaseManager<V> {
927
- add(idOrInstance: GuildIdResolvable, data: V): this | _discordjs_collection.Collection<string, V>;
955
+ add(idOrInstance: GuildIdResolvable, data: V): this;
928
956
  get(idOrInstance: GuildIdResolvable): V | undefined;
929
957
  remove(idOrInstance: GuildIdResolvable): boolean;
930
958
  has(idOrInstance: GuildIdResolvable): boolean;
@@ -932,138 +960,123 @@ declare abstract class GuildIdManager<V> extends BaseManager<V> {
932
960
 
933
961
  /**
934
962
  * Manages voice connections for {@link DisTube}
935
- * @extends BaseManager
936
963
  */
937
964
  declare class DisTubeVoiceManager extends GuildIdManager<DisTubeVoice> {
938
965
  /**
939
966
  * Get a {@link DisTubeVoice}.
940
- * @method get
941
- * @memberof DisTubeVoiceManager#
942
- * @param {GuildIdResolvable} guild The queue resolvable to resolve
943
- * @returns {DisTubeVoice?}
967
+ *
968
+ * @param guild - The queue resolvable to resolve
944
969
  */
945
970
  /**
946
971
  * Collection of {@link DisTubeVoice}.
947
- * @name DisTubeVoiceManager#collection
948
- * @type {Discord.Collection<string, DisTubeVoice>}
949
972
  */
950
973
  /**
951
974
  * Create a {@link DisTubeVoice}
952
- * @param {Discord.BaseGuildVoiceChannel} channel A voice channel to join
953
- * @returns {DisTubeVoice}
954
- * @private
975
+ *
976
+ * @param channel - A voice channel to join
955
977
  */
956
978
  create(channel: VoiceBasedChannel): DisTubeVoice;
957
979
  /**
958
980
  * Join a voice channel
959
- * @param {Discord.BaseGuildVoiceChannel} channel A voice channel to join
960
- * @returns {Promise<DisTubeVoice>}
981
+ *
982
+ * @param channel - A voice channel to join
961
983
  */
962
984
  join(channel: VoiceBasedChannel): Promise<DisTubeVoice>;
963
985
  /**
964
986
  * Leave the connected voice channel in a guild
965
- * @param {GuildIdResolvable} guild Queue Resolvable
987
+ *
988
+ * @param guild - Queue Resolvable
966
989
  */
967
990
  leave(guild: GuildIdResolvable): void;
968
991
  }
969
992
 
970
993
  /**
971
994
  * Manage filters of a playing {@link Queue}
972
- * @extends {BaseManager}
973
995
  */
974
996
  declare class FilterManager extends BaseManager<Filter> {
975
997
  #private;
976
998
  /**
977
999
  * Collection of {@link Filter}.
978
- * @name FilterManager#collection
979
- * @type {Discord.Collection<string, DisTubeVoice>}
980
1000
  */
981
1001
  queue: Queue;
982
1002
  constructor(queue: Queue);
983
1003
  /**
984
1004
  * Enable a filter or multiple filters to the manager
985
- * @param {FilterResolvable|FilterResolvable[]} filterOrFilters The filter or filters to enable
986
- * @param {boolean} [override=false] Wether or not override the applied filter with new filter value
987
- * @returns {FilterManager}
1005
+ *
1006
+ * @param filterOrFilters - The filter or filters to enable
1007
+ * @param override - Wether or not override the applied filter with new filter value
988
1008
  */
989
1009
  add(filterOrFilters: FilterResolvable | FilterResolvable[], override?: boolean): this;
990
1010
  /**
991
1011
  * Clear enabled filters of the manager
992
- * @returns {FilterManager}
993
1012
  */
994
1013
  clear(): this;
995
1014
  /**
996
1015
  * Set the filters applied to the manager
997
- * @param {FilterResolvable[]} filters The filters to apply
998
- * @returns {FilterManager}
1016
+ *
1017
+ * @param filters - The filters to apply
999
1018
  */
1000
1019
  set(filters: FilterResolvable[]): this;
1001
1020
  /**
1002
1021
  * Disable a filter or multiple filters
1003
- * @param {FilterResolvable|FilterResolvable[]} filterOrFilters The filter or filters to disable
1004
- * @returns {FilterManager}
1022
+ *
1023
+ * @param filterOrFilters - The filter or filters to disable
1005
1024
  */
1006
1025
  remove(filterOrFilters: FilterResolvable | FilterResolvable[]): this;
1007
1026
  /**
1008
1027
  * Check whether a filter enabled or not
1009
- * @param {FilterResolvable} filter The filter to check
1010
- * @returns {boolean}
1028
+ *
1029
+ * @param filter - The filter to check
1011
1030
  */
1012
1031
  has(filter: FilterResolvable): boolean;
1013
1032
  /**
1014
1033
  * Array of enabled filter names
1015
- * @type {Array<string>}
1016
- * @readonly
1017
1034
  */
1018
1035
  get names(): string[];
1019
1036
  /**
1020
1037
  * Array of enabled filters
1021
- * @type {Array<Filter>}
1022
- * @readonly
1023
1038
  */
1024
1039
  get values(): Filter[];
1025
- get ffmpegArgs(): string[];
1040
+ get ffmpegArgs(): FFmpegArgs;
1026
1041
  toString(): string;
1027
1042
  }
1028
1043
 
1029
1044
  /**
1030
1045
  * Queue manager
1031
- * @extends GuildIdManager
1032
1046
  */
1033
1047
  declare class QueueManager extends GuildIdManager<Queue> {
1034
1048
  #private;
1035
1049
  /**
1036
1050
  * Collection of {@link Queue}.
1037
- * @name QueueManager#collection
1038
- * @type {Discord.Collection<string, Queue>}
1039
1051
  */
1040
1052
  /**
1041
1053
  * Create a {@link Queue}
1042
- * @private
1043
- * @param {Discord.BaseGuildVoiceChannel} channel A voice channel
1044
- * @param {Song|Song[]} song First song
1045
- * @param {Discord.BaseGuildTextChannel} textChannel Default text channel
1046
- * @returns {Promise<Queue|true>} Returns `true` if encounter an error
1054
+ *
1055
+ * @param channel - A voice channel
1056
+ * @param song - First song
1057
+ * @param textChannel - Default text channel
1058
+ *
1059
+ * @returns Returns `true` if encounter an error
1047
1060
  */
1048
1061
  create(channel: VoiceBasedChannel, song: Song[] | Song, textChannel?: GuildTextBasedChannel): Promise<Queue | true>;
1049
1062
  /**
1050
1063
  * Create a ytdl stream
1051
- * @param {Queue} queue Queue
1052
- * @returns {DisTubeStream}
1064
+ *
1065
+ * @param queue - Queue
1053
1066
  */
1054
1067
  createStream(queue: Queue): DisTubeStream;
1055
1068
  /**
1056
1069
  * Play a song on voice connection
1057
- * @private
1058
- * @param {Queue} queue The guild queue
1059
- * @returns {Promise<boolean>} error?
1070
+ *
1071
+ * @param queue - The guild queue
1072
+ *
1073
+ * @returns error?
1060
1074
  */
1061
1075
  playSong(queue: Queue): Promise<boolean>;
1062
1076
  }
1063
1077
 
1064
1078
  /**
1065
1079
  * Represents a queue.
1066
- * @extends DisTubeBase
1067
1080
  */
1068
1081
  declare class Queue extends DisTubeBase {
1069
1082
  #private;
@@ -1085,125 +1098,123 @@ declare class Queue extends DisTubeBase {
1085
1098
  _listeners?: DisTubeVoiceEvents;
1086
1099
  /**
1087
1100
  * Create a queue for the guild
1088
- * @param {DisTube} distube DisTube
1089
- * @param {DisTubeVoice} voice Voice connection
1090
- * @param {Song|Song[]} song First song(s)
1091
- * @param {Discord.BaseGuildTextChannel?} textChannel Default text channel
1101
+ *
1102
+ * @param distube - DisTube
1103
+ * @param voice - Voice connection
1104
+ * @param song - First song(s)
1105
+ * @param textChannel - Default text channel
1092
1106
  */
1093
1107
  constructor(distube: DisTube, voice: DisTubeVoice, song: Song | Song[], textChannel?: GuildTextBasedChannel);
1094
1108
  /**
1095
1109
  * The client user as a `GuildMember` of this queue's guild
1096
- * @type {Discord.GuildMember?}
1097
1110
  */
1098
1111
  get clientMember(): discord_js.GuildMember | undefined;
1099
1112
  /**
1100
1113
  * The filter manager of the queue
1101
- * @type {FilterManager}
1102
- * @readonly
1103
1114
  */
1104
1115
  get filters(): FilterManager;
1105
1116
  /**
1106
1117
  * Formatted duration string.
1107
- * @type {string}
1108
- * @readonly
1109
1118
  */
1110
1119
  get formattedDuration(): string;
1111
1120
  /**
1112
1121
  * Queue's duration.
1113
- * @type {number}
1114
- * @readonly
1115
1122
  */
1116
1123
  get duration(): number;
1117
1124
  /**
1118
1125
  * What time in the song is playing (in seconds).
1119
- * @type {number}
1120
- * @readonly
1121
1126
  */
1122
1127
  get currentTime(): number;
1123
1128
  /**
1124
1129
  * Formatted {@link Queue#currentTime} string.
1125
- * @type {string}
1126
- * @readonly
1127
1130
  */
1128
1131
  get formattedCurrentTime(): string;
1129
1132
  /**
1130
1133
  * The voice channel playing in.
1131
- * @type {Discord.VoiceChannel|Discord.StageChannel|null}
1132
- * @readonly
1133
1134
  */
1134
1135
  get voiceChannel(): discord_js.VoiceBasedChannel | null;
1135
1136
  get volume(): number;
1136
1137
  set volume(value: number);
1137
1138
  /**
1138
- * @private
1139
- * Add a Song or an array of Song to the queue
1140
- * @param {Song|Song[]} song Song to add
1141
- * @param {number} [position=0] Position to add, <= 0 to add to the end of the queue
1142
- * @throws {Error}
1143
- * @returns {Queue} The guild queue
1139
+ * @throws {DisTubeError}
1140
+ *
1141
+ * @param song - Song to add
1142
+ * @param position - Position to add, \<= 0 to add to the end of the queue
1143
+ *
1144
+ * @returns The guild queue
1144
1145
  */
1145
1146
  addToQueue(song: Song | Song[], position?: number): Queue;
1146
1147
  /**
1147
1148
  * Pause the guild stream
1148
- * @returns {Queue} The guild queue
1149
+ *
1150
+ * @returns The guild queue
1149
1151
  */
1150
1152
  pause(): Queue;
1151
1153
  /**
1152
1154
  * Resume the guild stream
1153
- * @returns {Queue} The guild queue
1155
+ *
1156
+ * @returns The guild queue
1154
1157
  */
1155
1158
  resume(): Queue;
1156
1159
  /**
1157
1160
  * Set the guild stream's volume
1158
- * @param {number} percent The percentage of volume you want to set
1159
- * @returns {Queue} The guild queue
1161
+ *
1162
+ * @param percent - The percentage of volume you want to set
1163
+ *
1164
+ * @returns The guild queue
1160
1165
  */
1161
1166
  setVolume(percent: number): Queue;
1162
1167
  /**
1163
- * Skip the playing song if there is a next song in the queue.
1164
- * <info>If {@link Queue#autoplay} is `true` and there is no up next song,
1165
- * DisTube will add and play a related song.</info>
1166
- * @returns {Promise<Song>} The song will skip to
1167
- * @throws {Error}
1168
+ * Skip the playing song if there is a next song in the queue. <info>If {@link
1169
+ * Queue#autoplay} is `true` and there is no up next song, DisTube will add and
1170
+ * play a related song.</info>
1171
+ *
1172
+ * @returns The song will skip to
1168
1173
  */
1169
1174
  skip(): Promise<Song>;
1170
1175
  /**
1171
1176
  * Play the previous song if exists
1172
- * @returns {Promise<Song>} The guild queue
1173
- * @throws {Error}
1177
+ *
1178
+ * @returns The guild queue
1174
1179
  */
1175
1180
  previous(): Promise<Song>;
1176
1181
  /**
1177
1182
  * Shuffle the queue's songs
1178
- * @returns {Promise<Queue>} The guild queue
1183
+ *
1184
+ * @returns The guild queue
1179
1185
  */
1180
1186
  shuffle(): Promise<Queue>;
1181
1187
  /**
1182
- * Jump to the song position in the queue.
1183
- * The next one is 1, 2,...
1184
- * The previous one is -1, -2,...
1185
- * @param {number} position The song position to play
1186
- * @returns {Promise<Song>} The new Song will be played
1187
- * @throws {Error} if `num` is invalid number
1188
+ * Jump to the song position in the queue. The next one is 1, 2,... The previous
1189
+ * one is -1, -2,...
1190
+ * if `num` is invalid number
1191
+ *
1192
+ * @param position - The song position to play
1193
+ *
1194
+ * @returns The new Song will be played
1188
1195
  */
1189
1196
  jump(position: number): Promise<Song>;
1190
1197
  /**
1191
- * Set the repeat mode of the guild queue.\
1198
+ * Set the repeat mode of the guild queue.
1192
1199
  * Toggle mode `(Disabled -> Song -> Queue -> Disabled ->...)` if `mode` is `undefined`
1193
- * @param {RepeatMode?} [mode] The repeat modes (toggle if `undefined`)
1194
- * @returns {RepeatMode} The new repeat mode
1200
+ *
1201
+ * @param mode - The repeat modes (toggle if `undefined`)
1202
+ *
1203
+ * @returns The new repeat mode
1195
1204
  */
1196
1205
  setRepeatMode(mode?: RepeatMode): RepeatMode;
1197
1206
  /**
1198
1207
  * Set the playing time to another position
1199
- * @param {number} time Time in seconds
1200
- * @returns {Queue} The guild queue
1208
+ *
1209
+ * @param time - Time in seconds
1210
+ *
1211
+ * @returns The guild queue
1201
1212
  */
1202
1213
  seek(time: number): Queue;
1203
1214
  /**
1204
1215
  * Add a related song of the playing song to the queue
1205
- * @returns {Promise<Song>} The added song
1206
- * @throws {Error}
1216
+ *
1217
+ * @returns The added song
1207
1218
  */
1208
1219
  addRelatedSong(): Promise<Song>;
1209
1220
  /**
@@ -1211,22 +1222,22 @@ declare class Queue extends DisTubeBase {
1211
1222
  */
1212
1223
  stop(): Promise<void>;
1213
1224
  /**
1214
- * Remove the queue from the manager
1215
- * (This does not leave the voice channel even if {@link DisTubeOptions|DisTubeOptions.leaveOnStop} is enabled)
1216
- * @private
1225
+ * Remove the queue from the manager (This does not leave the voice channel even if
1226
+ * {@link DisTubeOptions | DisTubeOptions.leaveOnStop} is enabled)
1217
1227
  */
1218
1228
  remove(): void;
1219
1229
  /**
1220
1230
  * Toggle autoplay mode
1221
- * @returns {boolean} Autoplay mode state
1231
+ *
1232
+ * @returns Autoplay mode state
1222
1233
  */
1223
1234
  toggleAutoplay(): boolean;
1224
1235
  }
1225
1236
 
1226
1237
  /**
1227
1238
  * DisTube Plugin
1228
- * @abstract
1229
- * @private
1239
+ *
1240
+ * @virtual
1230
1241
  */
1231
1242
  declare abstract class Plugin {
1232
1243
  abstract type: PluginType;
@@ -1234,78 +1245,68 @@ declare abstract class Plugin {
1234
1245
  init(distube: DisTube): void;
1235
1246
  /**
1236
1247
  * Type of the plugin
1237
- * @name Plugin#type
1238
- * @type {PluginType}
1239
1248
  */
1240
1249
  /**
1241
1250
  * Emit an event to the {@link DisTube} class
1242
- * @param {string} eventName Event name
1243
- * @param {...any} args arguments
1244
- * @returns {boolean}
1251
+ *
1252
+ * @param eventName - Event name
1253
+ * @param args - arguments
1245
1254
  */
1246
1255
  emit(eventName: keyof DisTubeEvents, ...args: any): boolean;
1247
1256
  /**
1248
1257
  * Emit error event to the {@link DisTube} class
1249
- * @param {Error} error error
1250
- * @param {Discord.BaseGuildTextChannel} [channel] Text channel where the error is encountered.
1258
+ *
1259
+ * @param error - error
1260
+ * @param channel - Text channel where the error is encountered.
1251
1261
  */
1252
1262
  emitError(error: Error, channel?: GuildTextBasedChannel): void;
1253
1263
  /**
1254
1264
  * The queue manager
1255
- * @type {QueueManager}
1256
- * @readonly
1257
1265
  */
1258
1266
  get queues(): QueueManager;
1259
1267
  /**
1260
1268
  * The voice manager
1261
- * @type {DisTubeVoiceManager}
1262
- * @readonly
1263
1269
  */
1264
1270
  get voices(): DisTubeVoiceManager;
1265
1271
  /**
1266
1272
  * Discord.js client
1267
- * @type {Discord.Client}
1268
- * @readonly
1269
1273
  */
1270
1274
  get client(): Client;
1271
1275
  /**
1272
1276
  * DisTube options
1273
- * @type {DisTubeOptions}
1274
- * @readonly
1275
1277
  */
1276
1278
  get options(): Options;
1277
1279
  /**
1278
1280
  * DisTube handler
1279
- * @type {DisTubeHandler}
1280
- * @readonly
1281
1281
  */
1282
1282
  get handler(): DisTubeHandler;
1283
1283
  /**
1284
1284
  * Check if the string is working with this plugin
1285
- * @param {string} _string Input string
1286
- * @returns {boolean|Promise<boolean>}
1285
+ *
1286
+ * @param _string - Input string
1287
1287
  */
1288
1288
  validate(_string: string): Awaitable<boolean>;
1289
1289
  /**
1290
1290
  * Get the stream url from {@link Song#url}. Returns {@link Song#url} by default.
1291
1291
  * Not needed if the plugin plays song from YouTube.
1292
- * @param {string} url Input url
1293
- * @returns {string|Promise<string>}
1292
+ *
1293
+ * @param url - Input url
1294
1294
  */
1295
1295
  getStreamURL(url: string): Awaitable<string>;
1296
1296
  /**
1297
- * Get related songs from a supported url. {@link Song#member} should be `undefined`.
1298
- * Not needed to add {@link Song#related} because it will be added with this function later.
1299
- * @param {string} _url Input url
1300
- * @returns {Song[]|Promise<Song[]>}
1297
+ * Get related songs from a supported url. {@link Song#member} should be
1298
+ * `undefined`. Not needed to add {@link Song#related} because it will be added
1299
+ * with this function later.
1300
+ *
1301
+ * @param _url - Input url
1301
1302
  */
1302
1303
  getRelatedSongs(_url: string): Awaitable<RelatedSong[]>;
1303
1304
  }
1304
1305
 
1305
1306
  /**
1306
1307
  * Custom Plugin
1307
- * @extends Plugin
1308
- * @abstract
1308
+ *
1309
+ * @virtual
1309
1310
  */
1310
1311
  declare abstract class CustomPlugin extends Plugin {
1311
1312
  readonly type = PluginType.CUSTOM;
@@ -1314,8 +1315,8 @@ declare abstract class CustomPlugin extends Plugin {
1314
1315
 
1315
1316
  /**
1316
1317
  * Extractor Plugin
1317
- * @extends Plugin
1318
- * @abstract
1318
+ *
1319
+ * @virtual
1319
1320
  */
1320
1321
  declare abstract class ExtractorPlugin extends Plugin {
1321
1322
  readonly type = PluginType.EXTRACTOR;
@@ -1327,38 +1328,39 @@ declare abstract class ExtractorPlugin extends Plugin {
1327
1328
 
1328
1329
  /**
1329
1330
  * Format duration to string
1330
- * @param {number} sec Duration in seconds
1331
- * @returns {string}
1331
+ *
1332
+ * @param sec - Duration in seconds
1332
1333
  */
1333
1334
  declare function formatDuration(sec: number): string;
1334
1335
  /**
1335
1336
  * Convert formatted duration to seconds
1336
- * @param {*} input Formatted duration string
1337
- * @returns {number}
1337
+ *
1338
+ * @param input - Formatted duration string
1338
1339
  */
1339
1340
  declare function toSecond(input: any): number;
1340
1341
  /**
1341
1342
  * Parse number from input
1342
- * @param {*} input Any
1343
- * @returns {number}
1343
+ *
1344
+ * @param input - Any
1344
1345
  */
1345
1346
  declare function parseNumber(input: any): number;
1346
1347
  declare const SUPPORTED_PROTOCOL: readonly ["https:", "http:", "file:"];
1347
1348
  /**
1348
1349
  * Check if the string is an URL
1349
- * @param {string} input input
1350
- * @returns {boolean}
1350
+ *
1351
+ * @param input - input
1351
1352
  */
1352
1353
  declare function isURL(input: any): input is `${(typeof SUPPORTED_PROTOCOL)[number]}//${string}`;
1353
1354
  /**
1354
1355
  * Check if the Client has enough intents to using DisTube
1355
- * @param {ClientOptions} options options
1356
+ *
1357
+ * @param options - options
1356
1358
  */
1357
1359
  declare function checkIntents(options: ClientOptions): void;
1358
1360
  /**
1359
1361
  * Check if the voice channel is empty
1360
- * @param {Discord.VoiceState} voiceState voiceState
1361
- * @returns {boolean}
1362
+ *
1363
+ * @param voiceState - voiceState
1362
1364
  */
1363
1365
  declare function isVoiceChannelEmpty(voiceState: VoiceState): boolean;
1364
1366
  declare function isSnowflake(id: any): id is Snowflake;
@@ -1387,9 +1389,246 @@ declare class DirectLinkPlugin extends ExtractorPlugin {
1387
1389
  }
1388
1390
 
1389
1391
  declare const version: string;
1392
+ interface DisTube extends TypedEmitter<TypedDisTubeEvents> {
1393
+ /**
1394
+ * @event
1395
+ * Emitted after DisTube add a new playlist to the playing {@link Queue}.
1396
+ *
1397
+ * @example
1398
+ * ```ts
1399
+ * distube.on("addList", (queue, playlist) => queue.textChannel.send(
1400
+ * `Added \`${playlist.name}\` playlist (${playlist.songs.length} songs) to the queue!`
1401
+ * ));
1402
+ * ```
1403
+ *
1404
+ * @param queue - The guild queue
1405
+ * @param playlist - Playlist info
1406
+ */
1407
+ [Events.ADD_LIST]: (queue: Queue, playlist: Playlist) => Awaitable;
1408
+ /**
1409
+ * @event
1410
+ * Emitted after DisTube add a new song to the playing {@link Queue}.
1411
+ *
1412
+ * @example
1413
+ * ```ts
1414
+ * distube.on("addSong", (queue, song) => queue.textChannel.send(
1415
+ * `Added ${song.name} - \`${song.formattedDuration}\` to the queue by ${song.user}.`
1416
+ * ));
1417
+ * ```
1418
+ *
1419
+ * @param queue - The guild queue
1420
+ * @param song - Added song
1421
+ */
1422
+ [Events.ADD_SONG]: (queue: Queue, song: Song) => Awaitable;
1423
+ /**
1424
+ * @event
1425
+ * Emitted when a {@link Queue} is deleted with any reasons.
1426
+ *
1427
+ * @param queue - The guild queue
1428
+ */
1429
+ [Events.DELETE_QUEUE]: (queue: Queue) => Awaitable;
1430
+ /**
1431
+ * @event
1432
+ * Emitted when the bot is disconnected to a voice channel.
1433
+ *
1434
+ * @param queue - The guild queue
1435
+ */
1436
+ [Events.DISCONNECT]: (queue: Queue) => Awaitable;
1437
+ /**
1438
+ * @event
1439
+ * Emitted when there is no user in the voice channel, {@link DisTubeOptions}.leaveOnEmpty
1440
+ * is `true` and there is a playing queue.
1441
+ *
1442
+ * If there is no playing queue (stopped and {@link DisTubeOptions}.leaveOnStop is
1443
+ * `false`), it will leave the channel without emitting this event.
1444
+ *
1445
+ * @example
1446
+ * ```ts
1447
+ * distube.on("empty", queue => queue.textChannel.send("Channel is empty. Leaving the channel"))
1448
+ * ```
1449
+ *
1450
+ * @param queue - The guild queue
1451
+ */
1452
+ [Events.EMPTY]: (queue: Queue) => Awaitable;
1453
+ /**
1454
+ * @event
1455
+ * Emitted when DisTube encounters an error while playing songs.
1456
+ *
1457
+ * @example
1458
+ * ```ts
1459
+ * distube.on('error', (channel, e) => {
1460
+ * if (channel) channel.send(`An error encountered: ${e}`)
1461
+ * else console.error(e)
1462
+ * })
1463
+ * ```
1464
+ *
1465
+ * @param channel - Text channel where the error is encountered.
1466
+ * @param error - The error encountered
1467
+ */
1468
+ [Events.ERROR]: (channel: GuildTextBasedChannel | undefined, error: Error) => Awaitable;
1469
+ /**
1470
+ * @event
1471
+ * Emitted for FFmpeg debugging information.
1472
+ *
1473
+ * @param debug - The debug information
1474
+ */
1475
+ [Events.FFMPEG_DEBUG]: (debug: string) => Awaitable;
1476
+ /**
1477
+ * @event
1478
+ * Emitted when there is no more song in the queue and {@link Queue#autoplay} is
1479
+ * `false`. DisTube will leave voice channel if {@link
1480
+ * DisTubeOptions}.leaveOnFinish is `true`.
1481
+ *
1482
+ * @example
1483
+ * ```ts
1484
+ * distube.on("finish", queue => queue.textChannel.send("No more song in queue"));
1485
+ * ```
1486
+ *
1487
+ * @param queue - The guild queue
1488
+ */
1489
+ [Events.FINISH]: (queue: Queue) => Awaitable;
1490
+ /**
1491
+ * @event
1492
+ * Emitted when DisTube finished a song.
1493
+ *
1494
+ * @example
1495
+ * ```ts
1496
+ * distube.on("finishSong", (queue, song) => queue.textChannel.send(`${song.name} has finished!`));
1497
+ * ```
1498
+ *
1499
+ * @param queue - The guild queue
1500
+ * @param song - Finished song
1501
+ */
1502
+ [Events.FINISH_SONG]: (queue: Queue, song: Song) => Awaitable;
1503
+ /**
1504
+ * @event
1505
+ * Emitted when DisTube initialize a queue to change queue default properties.
1506
+ *
1507
+ * @example
1508
+ * ```ts
1509
+ * distube.on("initQueue", queue => {
1510
+ * queue.autoplay = false;
1511
+ * queue.volume = 100;
1512
+ * });
1513
+ * ```ts
1514
+ *
1515
+ * @param queue - The guild queue
1516
+ */
1517
+ [Events.INIT_QUEUE]: (queue: Queue) => Awaitable;
1518
+ /**
1519
+ * @event
1520
+ * Emitted when {@link Queue#autoplay} is `true`, {@link Queue#songs} is empty, and
1521
+ * DisTube cannot find related songs to play.
1522
+ *
1523
+ * @example
1524
+ * ```ts
1525
+ * distube.on("noRelated", queue => queue.textChannel.send("Can't find related video to play."));
1526
+ * ```ts
1527
+ *
1528
+ * @param queue - The guild queue
1529
+ */
1530
+ [Events.NO_RELATED]: (queue: Queue) => Awaitable;
1531
+ /**
1532
+ * @event
1533
+ * Emitted when DisTube play a song.
1534
+ *
1535
+ * If {@link DisTubeOptions}.emitNewSongOnly is `true`, this event is not emitted
1536
+ * when looping a song or next song is the previous one.
1537
+ *
1538
+ * @example
1539
+ * ```ts
1540
+ * distube.on("playSong", (queue, song) => queue.textChannel.send(
1541
+ * `Playing \`${song.name}\` - \`${song.formattedDuration}\`\nRequested by: ${song.user}`
1542
+ * ));
1543
+ * ```ts
1544
+ *
1545
+ * @param queue - The guild queue
1546
+ * @param song - Playing song
1547
+ */
1548
+ [Events.PLAY_SONG]: (queue: Queue, song: Song) => Awaitable;
1549
+ /**
1550
+ * @event
1551
+ * Emitted when {@link DisTubeOptions | DisTubeOptions.searchSongs} bigger than 0,
1552
+ * and the search canceled due to {@link DisTubeOptions |
1553
+ * DisTubeOptions.searchTimeout}.
1554
+ *
1555
+ * @example
1556
+ * ```ts
1557
+ * // DisTubeOptions.searchSongs > 0
1558
+ * distube.on("searchCancel", (message) => message.channel.send(`Searching canceled`));
1559
+ * ```ts
1560
+ *
1561
+ * @param message - The user message called play method
1562
+ * @param query - The search query
1563
+ */
1564
+ [Events.SEARCH_CANCEL]: (message: Message, query: string) => Awaitable;
1565
+ /**
1566
+ * @event
1567
+ * Emitted when {@link DisTubeOptions | DisTubeOptions.searchSongs} bigger than 0,
1568
+ * and after the user chose a search result to play.
1569
+ *
1570
+ * @param message - The user message called play method
1571
+ * @param answer - The answered message of user
1572
+ * @param query - The search query
1573
+ */
1574
+ [Events.SEARCH_DONE]: (message: Message, answer: string, query: string) => Awaitable;
1575
+ /**
1576
+ * @event
1577
+ * Emitted when {@link DisTubeOptions | DisTubeOptions.searchSongs} bigger than 0,
1578
+ * and the search canceled due to user's next message is not a number or out of
1579
+ * results range.
1580
+ *
1581
+ * @example
1582
+ * ```ts
1583
+ * // DisTubeOptions.searchSongs > 0
1584
+ * distube.on("searchInvalidAnswer", (message) => message.channel.send(`You answered an invalid number!`));
1585
+ * ```ts
1586
+ *
1587
+ * @param message - The user message called play method
1588
+ * @param answer - The answered message of user
1589
+ * @param query - The search query
1590
+ */
1591
+ [Events.SEARCH_INVALID_ANSWER]: (message: Message, answer: string, query: string) => Awaitable;
1592
+ /**
1593
+ * @event
1594
+ * Emitted when DisTube cannot find any results for the query.
1595
+ *
1596
+ * @example
1597
+ * ```ts
1598
+ * distube.on("searchNoResult", (message, query) => message.channel.send(`No result found for ${query}!`));
1599
+ * ```ts
1600
+ *
1601
+ * @param message - The user message called play method
1602
+ * @param query - The search query
1603
+ */
1604
+ [Events.SEARCH_NO_RESULT]: (message: Message, query: string) => Awaitable;
1605
+ /**
1606
+ * @event
1607
+ * Emitted when {@link DisTubeOptions | DisTubeOptions.searchSongs} bigger than 0,
1608
+ * and song param of {@link DisTube#play} is invalid url. DisTube will wait for
1609
+ * user's next message to choose a song manually. <info>{@link
1610
+ * https://support.google.com/youtube/answer/7354993 | Safe search} is enabled if
1611
+ * {@link DisTubeOptions}.nsfw is disabled and the message's channel is not a nsfw
1612
+ * channel.</info>
1613
+ *
1614
+ * @example
1615
+ * ```ts
1616
+ * // DisTubeOptions.searchSongs > 0
1617
+ * distube.on("searchResult", (message, results) => {
1618
+ * message.channel.send(`**Choose an option from below**\n${
1619
+ * results.map((song, i) => `**${i + 1}**. ${song.name} - \`${song.formattedDuration}\``).join("\n")
1620
+ * }\n*Enter anything else or wait 60 seconds to cancel*`);
1621
+ * });
1622
+ * ```ts
1623
+ *
1624
+ * @param message - The user message called play method
1625
+ * @param results - Searched results
1626
+ * @param query - The search query
1627
+ */
1628
+ [Events.SEARCH_RESULT]: (message: Message, results: SearchResult[], query: string) => Awaitable;
1629
+ }
1390
1630
  /**
1391
1631
  * DisTube class
1392
- * @extends EventEmitter
1393
1632
  */
1394
1633
  declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1395
1634
  #private;
@@ -1402,17 +1641,17 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1402
1641
  readonly customPlugins: CustomPlugin[];
1403
1642
  readonly filters: Filters;
1404
1643
  /**
1405
- * @deprecated Use `youtubeCookie: Cookie[]` instead. Guide: {@link https://distube.js.org/#/docs/DisTube/main/general/cookie YouTube Cookies}
1644
+ * @deprecated Use `youtubeCookie: Cookie[]` instead. Guide: {@link
1645
+ * https://github.com/skick1234/DisTube/wiki/YouTube-Cookies | YouTube Cookies}
1406
1646
  */
1407
- constructor(client: Client, otp: DisTubeOptions & {
1647
+ constructor(client: Client, opts: DisTubeOptions & {
1408
1648
  youtubeCookie: string;
1409
1649
  });
1410
1650
  /**
1411
1651
  * Create a new DisTube class.
1412
- * @param {Discord.Client} client Discord.JS client
1413
- * @param {DisTubeOptions} [otp] Custom DisTube options
1414
- * @throws {DisTubeError}
1652
+ *
1415
1653
  * @example
1654
+ * ```ts
1416
1655
  * const Discord = require('discord.js'),
1417
1656
  * DisTube = require('distube'),
1418
1657
  * client = new Discord.Client();
@@ -1420,24 +1659,25 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1420
1659
  * const distube = new DisTube.default(client, { searchSongs: 10 });
1421
1660
  * // client.DisTube = distube // make it access easily
1422
1661
  * client.login("Your Discord Bot Token")
1662
+ * ```ts
1663
+ *
1664
+ * @throws {@link DisTubeError}
1665
+ *
1666
+ * @param client - Discord.JS client
1667
+ * @param opts - Custom DisTube options
1423
1668
  */
1424
- constructor(client: Client, otp?: DisTubeOptions);
1669
+ constructor(client: Client, opts?: DisTubeOptions);
1425
1670
  static get version(): string;
1426
1671
  /**
1427
1672
  * DisTube version
1428
- * @type {string}
1429
1673
  */
1430
1674
  get version(): string;
1431
1675
  /**
1432
- * Play / add a song or playlist from url. Search and play a song if it is not a valid url.
1676
+ * Play / add a song or playlist from url. Search and play a song if it is not a
1677
+ * valid url.
1433
1678
  *
1434
- * @param {Discord.BaseGuildVoiceChannel} voiceChannel The channel will be joined if the bot isn't in any channels,
1435
- * the bot will be moved to this channel if {@link DisTubeOptions}.joinNewVoiceChannel is `true`
1436
- * @param {string|Song|SearchResult|Playlist} song URL | Search string |
1437
- * {@link Song} | {@link SearchResult} | {@link Playlist}
1438
- * @param {PlayOptions} [options] Optional options
1439
- * @throws {DisTubeError}
1440
1679
  * @example
1680
+ * ```ts
1441
1681
  * client.on('message', (message) => {
1442
1682
  * if (!message.content.startsWith(config.prefix)) return;
1443
1683
  * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
@@ -1449,15 +1689,21 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1449
1689
  * message
1450
1690
  * });
1451
1691
  * });
1452
- * @returns {Promise<void>}
1692
+ * ```ts
1693
+ *
1694
+ * @throws {@link DisTubeError}
1695
+ *
1696
+ * @param voiceChannel - The channel will be joined if the bot isn't in any channels, the bot will be
1697
+ * moved to this channel if {@link DisTubeOptions}.joinNewVoiceChannel is `true`
1698
+ * @param song - URL | Search string | {@link Song} | {@link SearchResult} | {@link Playlist}
1699
+ * @param options - Optional options
1453
1700
  */
1454
1701
  play(voiceChannel: VoiceBasedChannel, song: string | Song | SearchResult | Playlist, options?: PlayOptions): Promise<void>;
1455
1702
  /**
1456
1703
  * Create a custom playlist
1457
- * @returns {Promise<Playlist>}
1458
- * @param {Array<string|Song|SearchResult>} songs Array of url, Song or SearchResult
1459
- * @param {CustomPlaylistOptions} [options] Optional options
1704
+ *
1460
1705
  * @example
1706
+ * ```ts
1461
1707
  * const songs = ["https://www.youtube.com/watch?v=xxx", "https://www.youtube.com/watch?v=yyy"];
1462
1708
  * const playlist = await distube.createCustomPlaylist(songs, {
1463
1709
  * member: message.member,
@@ -1465,6 +1711,10 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1465
1711
  * parallel: true
1466
1712
  * });
1467
1713
  * distube.play(voiceChannel, playlist, { ... });
1714
+ * ```ts
1715
+ *
1716
+ * @param songs - Array of url, Song or SearchResult
1717
+ * @param options - Optional options
1468
1718
  */
1469
1719
  createCustomPlaylist(songs: (string | Song | SearchResult)[], options?: CustomPlaylistOptions): Promise<Playlist>;
1470
1720
  search(string: string, options?: {
@@ -1487,10 +1737,9 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1487
1737
  }): Promise<Array<SearchResult>>;
1488
1738
  /**
1489
1739
  * Get the guild queue
1490
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1491
- * @returns {Queue?}
1492
- * @throws {Error}
1740
+ *
1493
1741
  * @example
1742
+ * ```ts
1494
1743
  * client.on('message', (message) => {
1495
1744
  * if (!message.content.startsWith(config.prefix)) return;
1496
1745
  * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
@@ -1502,28 +1751,32 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1502
1751
  * ).join("\n"));
1503
1752
  * }
1504
1753
  * });
1754
+ * ```ts
1755
+ *
1756
+ * @param guild - The type can be resolved to give a {@link Queue}
1505
1757
  */
1506
1758
  getQueue(guild: GuildIdResolvable): Queue | undefined;
1507
1759
  /**
1508
1760
  * Pause the guild stream
1509
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1510
- * @returns {Queue} The guild queue
1511
- * @throws {Error}
1761
+ *
1762
+ * @param guild - The type can be resolved to give a {@link Queue}
1763
+ *
1764
+ * @returns The guild queue
1512
1765
  */
1513
1766
  pause(guild: GuildIdResolvable): Queue;
1514
1767
  /**
1515
1768
  * Resume the guild stream
1516
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1517
- * @returns {Queue} The guild queue
1518
- * @throws {Error}
1769
+ *
1770
+ * @param guild - The type can be resolved to give a {@link Queue}
1771
+ *
1772
+ * @returns The guild queue
1519
1773
  */
1520
1774
  resume(guild: GuildIdResolvable): Queue;
1521
1775
  /**
1522
1776
  * Stop the guild stream
1523
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1524
- * @returns {Promise<void>}
1525
- * @throws {Error}
1777
+ *
1526
1778
  * @example
1779
+ * ```ts
1527
1780
  * client.on('message', (message) => {
1528
1781
  * if (!message.content.startsWith(config.prefix)) return;
1529
1782
  * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
@@ -1533,15 +1786,16 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1533
1786
  * message.channel.send("Stopped the queue!");
1534
1787
  * }
1535
1788
  * });
1789
+ * ```ts
1790
+ *
1791
+ * @param guild - The type can be resolved to give a {@link Queue}
1536
1792
  */
1537
1793
  stop(guild: GuildIdResolvable): Promise<void>;
1538
1794
  /**
1539
1795
  * Set the guild stream's volume
1540
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1541
- * @param {number} percent The percentage of volume you want to set
1542
- * @returns {Queue} The guild queue
1543
- * @throws {Error}
1796
+ *
1544
1797
  * @example
1798
+ * ```ts
1545
1799
  * client.on('message', (message) => {
1546
1800
  * if (!message.content.startsWith(config.prefix)) return;
1547
1801
  * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
@@ -1549,16 +1803,21 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1549
1803
  * if (command == "volume")
1550
1804
  * distube.setVolume(message, Number(args[0]));
1551
1805
  * });
1806
+ * ```ts
1807
+ *
1808
+ * @param guild - The type can be resolved to give a {@link Queue}
1809
+ * @param percent - The percentage of volume you want to set
1810
+ *
1811
+ * @returns The guild queue
1552
1812
  */
1553
1813
  setVolume(guild: GuildIdResolvable, percent: number): Queue;
1554
1814
  /**
1555
- * Skip the playing song if there is a next song in the queue.
1556
- * <info>If {@link Queue#autoplay} is `true` and there is no up next song,
1557
- * DisTube will add and play a related song.</info>
1558
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1559
- * @returns {Promise<Song>} The new Song will be played
1560
- * @throws {Error}
1815
+ * Skip the playing song if there is a next song in the queue. <info>If {@link
1816
+ * Queue#autoplay} is `true` and there is no up next song, DisTube will add and
1817
+ * play a related song.</info>
1818
+ *
1561
1819
  * @example
1820
+ * ```ts
1562
1821
  * client.on('message', (message) => {
1563
1822
  * if (!message.content.startsWith(config.prefix)) return;
1564
1823
  * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
@@ -1566,14 +1825,18 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1566
1825
  * if (command == "skip")
1567
1826
  * distube.skip(message);
1568
1827
  * });
1828
+ * ```ts
1829
+ *
1830
+ * @param guild - The type can be resolved to give a {@link Queue}
1831
+ *
1832
+ * @returns The new Song will be played
1569
1833
  */
1570
1834
  skip(guild: GuildIdResolvable): Promise<Song>;
1571
1835
  /**
1572
1836
  * Play the previous song
1573
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1574
- * @returns {Promise<Song>} The new Song will be played
1575
- * @throws {Error}
1837
+ *
1576
1838
  * @example
1839
+ * ```ts
1577
1840
  * client.on('message', (message) => {
1578
1841
  * if (!message.content.startsWith(config.prefix)) return;
1579
1842
  * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
@@ -1581,13 +1844,18 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1581
1844
  * if (command == "previous")
1582
1845
  * distube.previous(message);
1583
1846
  * });
1847
+ * ```ts
1848
+ *
1849
+ * @param guild - The type can be resolved to give a {@link Queue}
1850
+ *
1851
+ * @returns The new Song will be played
1584
1852
  */
1585
1853
  previous(guild: GuildIdResolvable): Promise<Song>;
1586
1854
  /**
1587
1855
  * Shuffle the guild queue songs
1588
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1589
- * @returns {Promise<Queue>} The guild queue
1856
+ *
1590
1857
  * @example
1858
+ * ```ts
1591
1859
  * client.on('message', (message) => {
1592
1860
  * if (!message.content.startsWith(config.prefix)) return;
1593
1861
  * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
@@ -1595,17 +1863,19 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1595
1863
  * if (command == "shuffle")
1596
1864
  * distube.shuffle(message);
1597
1865
  * });
1866
+ * ```ts
1867
+ *
1868
+ * @param guild - The type can be resolved to give a {@link Queue}
1869
+ *
1870
+ * @returns The guild queue
1598
1871
  */
1599
1872
  shuffle(guild: GuildIdResolvable): Promise<Queue>;
1600
1873
  /**
1601
- * Jump to the song number in the queue.
1602
- * The next one is 1, 2,...
1603
- * The previous one is -1, -2,...
1604
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1605
- * @param {number} num The song number to play
1606
- * @returns {Promise<Song>} The new Song will be played
1607
- * @throws {Error} if `num` is invalid number (0 < num < {@link Queue#songs}.length)
1874
+ * Jump to the song number in the queue. The next one is 1, 2,... The previous one
1875
+ * is -1, -2,...
1876
+ *
1608
1877
  * @example
1878
+ * ```ts
1609
1879
  * client.on('message', (message) => {
1610
1880
  * if (!message.content.startsWith(config.prefix)) return;
1611
1881
  * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
@@ -1614,15 +1884,20 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1614
1884
  * distube.jump(message, parseInt(args[0]))
1615
1885
  * .catch(err => message.channel.send("Invalid song number."));
1616
1886
  * });
1887
+ * ```ts
1888
+ *
1889
+ * @param guild - The type can be resolved to give a {@link Queue}
1890
+ * @param num - The song number to play
1891
+ *
1892
+ * @returns The new Song will be played
1617
1893
  */
1618
1894
  jump(guild: GuildIdResolvable, num: number): Promise<Song>;
1619
1895
  /**
1620
- * Set the repeat mode of the guild queue.\
1896
+ * Set the repeat mode of the guild queue.
1621
1897
  * Toggle mode `(Disabled -> Song -> Queue -> Disabled ->...)` if `mode` is `undefined`
1622
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1623
- * @param {RepeatMode?} [mode] The repeat modes (toggle if `undefined`)
1624
- * @returns {RepeatMode} The new repeat mode
1898
+ *
1625
1899
  * @example
1900
+ * ```ts
1626
1901
  * client.on('message', (message) => {
1627
1902
  * if (!message.content.startsWith(config.prefix)) return;
1628
1903
  * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
@@ -1633,7 +1908,9 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1633
1908
  * message.channel.send("Set repeat mode to `" + mode + "`");
1634
1909
  * }
1635
1910
  * });
1911
+ * ```ts
1636
1912
  * @example
1913
+ * ```ts
1637
1914
  * const { RepeatMode } = require("distube");
1638
1915
  * let mode;
1639
1916
  * switch(distube.setRepeatMode(message, parseInt(args[0]))) {
@@ -1648,14 +1925,19 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1648
1925
  * break;
1649
1926
  * }
1650
1927
  * message.channel.send("Set repeat mode to `" + mode + "`");
1928
+ * ```ts
1929
+ *
1930
+ * @param guild - The type can be resolved to give a {@link Queue}
1931
+ * @param mode - The repeat modes (toggle if `undefined`)
1932
+ *
1933
+ * @returns The new repeat mode
1651
1934
  */
1652
1935
  setRepeatMode(guild: GuildIdResolvable, mode?: number): number;
1653
1936
  /**
1654
1937
  * Toggle autoplay mode
1655
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1656
- * @returns {boolean} Autoplay mode state
1657
- * @throws {Error}
1938
+ *
1658
1939
  * @example
1940
+ * ```ts
1659
1941
  * client.on('message', (message) => {
1660
1942
  * if (!message.content.startsWith(config.prefix)) return;
1661
1943
  * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
@@ -1665,20 +1947,26 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1665
1947
  * message.channel.send("Set autoplay mode to `" + (mode ? "On" : "Off") + "`");
1666
1948
  * }
1667
1949
  * });
1950
+ * ```ts
1951
+ *
1952
+ * @param guild - The type can be resolved to give a {@link Queue}
1953
+ *
1954
+ * @returns Autoplay mode state
1668
1955
  */
1669
1956
  toggleAutoplay(guild: GuildIdResolvable): boolean;
1670
1957
  /**
1671
1958
  * Add related song to the queue
1672
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1673
- * @returns {Promise<Song>} The guild queue
1959
+ *
1960
+ * @param guild - The type can be resolved to give a {@link Queue}
1961
+ *
1962
+ * @returns The guild queue
1674
1963
  */
1675
1964
  addRelatedSong(guild: GuildIdResolvable): Promise<Song>;
1676
1965
  /**
1677
1966
  * Set the playing time to another position
1678
- * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}
1679
- * @param {number} time Time in seconds
1680
- * @returns {Queue} Seeked queue
1967
+ *
1681
1968
  * @example
1969
+ * ```ts
1682
1970
  * client.on('message', message => {
1683
1971
  * if (!message.content.startsWith(config.prefix)) return;
1684
1972
  * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
@@ -1686,15 +1974,21 @@ declare class DisTube extends TypedEmitter<TypedDisTubeEvents> {
1686
1974
  * if (command = 'seek')
1687
1975
  * distube.seek(message, Number(args[0]));
1688
1976
  * });
1977
+ * ```ts
1978
+ *
1979
+ * @param guild - The type can be resolved to give a {@link Queue}
1980
+ * @param time - Time in seconds
1981
+ *
1982
+ * @returns Seeked queue
1689
1983
  */
1690
1984
  seek(guild: GuildIdResolvable, time: number): Queue;
1691
1985
  /**
1692
1986
  * Emit error event
1693
- * @param {Error} error error
1694
- * @param {Discord.BaseGuildTextChannel} [channel] Text channel where the error is encountered.
1695
- * @private
1987
+ *
1988
+ * @param error - error
1989
+ * @param channel - Text channel where the error is encountered.
1696
1990
  */
1697
1991
  emitError(error: Error, channel?: GuildTextBasedChannel): void;
1698
1992
  }
1699
1993
 
1700
- export { Awaitable, BaseManager, Chapter, CustomPlaylistOptions, CustomPlugin, DirectLinkPlugin, DisTube, DisTubeBase, DisTubeError, DisTubeEvents, DisTubeHandler, DisTubeOptions, DisTubeStream, DisTubeVoice, DisTubeVoiceEvents, DisTubeVoiceManager, Events, ExtractorPlugin, Filter, FilterManager, FilterResolvable, Filters, GuildIdManager, GuildIdResolvable, Options, OtherSongInfo, PlayHandlerOptions, PlayOptions, Playlist, PlaylistInfo, Plugin, PluginType, Queue, QueueManager, RelatedSong, RepeatMode, ResolveOptions, ResolvePlaylistOptions, SearchResult, SearchResultPlaylist, SearchResultType, SearchResultVideo, Song, StreamType, TaskQueue, TypedDisTubeEvents, checkIntents, checkInvalidKey, chooseBestVideoFormat, DisTube as default, defaultFilters, defaultOptions, formatDuration, isClientInstance, isGuildInstance, isMemberInstance, isMessageInstance, isNsfwChannel, isObject, isRecord, isSnowflake, isSupportedVoiceChannel, isTextChannelInstance, isTruthy, isURL, isVoiceChannelEmpty, objectKeys, parseNumber, resolveGuildId, toSecond, version };
1994
+ export { type Awaitable, BaseManager, type Chapter, type CustomPlaylistOptions, CustomPlugin, DirectLinkPlugin, DisTube, DisTubeBase, DisTubeError, type DisTubeEvents, DisTubeHandler, type DisTubeOptions, DisTubeStream, DisTubeVoice, type DisTubeVoiceEvents, DisTubeVoiceManager, Events, ExtractorPlugin, type FFmpegArgs, type FFmpegOptions, type Filter, FilterManager, type FilterResolvable, type Filters, GuildIdManager, type GuildIdResolvable, Options, type OtherSongInfo, type PlayHandlerOptions, type PlayOptions, Playlist, type PlaylistInfo, Plugin, PluginType, Queue, QueueManager, type RelatedSong, RepeatMode, type ResolveOptions, type ResolvePlaylistOptions, type SearchResult, SearchResultPlaylist, SearchResultType, SearchResultVideo, Song, StreamType, TaskQueue, type TypedDisTubeEvents, checkFFmpeg, checkIntents, checkInvalidKey, chooseBestVideoFormat, DisTube as default, defaultFilters, defaultOptions, formatDuration, isClientInstance, isGuildInstance, isMemberInstance, isMessageInstance, isNsfwChannel, isObject, isRecord, isSnowflake, isSupportedVoiceChannel, isTextChannelInstance, isTruthy, isURL, isVoiceChannelEmpty, objectKeys, parseNumber, resolveGuildId, toSecond, version };