discord-player 6.6.3-dev.0 → 6.6.4

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
@@ -12,2541 +12,2599 @@ import { downloadOptions } from 'ytdl-core';
12
12
  import { BridgeProvider } from '@discord-player/extractor';
13
13
  export * from '@discord-player/ffmpeg';
14
14
 
15
- declare class PlayerEventsEmitter<L extends ListenerSignature<L> = DefaultListener> extends EventEmitter<L> {
16
- requiredEvents: Array<keyof L>;
17
- constructor(requiredEvents?: Array<keyof L>);
18
- emit<K extends keyof L>(name: K, ...args: Parameters<L[K]>): boolean;
15
+ declare class PlayerEventsEmitter<L extends ListenerSignature<L> = DefaultListener> extends EventEmitter<L> {
16
+ requiredEvents: Array<keyof L>;
17
+ constructor(requiredEvents?: Array<keyof L>);
18
+ emit<K extends keyof L>(name: K, ...args: Parameters<L[K]>): boolean;
19
19
  }
20
20
 
21
- interface CreateStreamOps {
22
- type?: StreamType;
23
- data?: any;
24
- disableVolume?: boolean;
25
- disableEqualizer?: boolean;
26
- disableBiquad?: boolean;
27
- eq?: EqualizerBand[];
28
- biquadFilter?: BiquadFilters;
29
- disableFilters?: boolean;
30
- defaultFilters?: PCMFilters[];
31
- volume?: number;
32
- disableResampler?: boolean;
33
- sampleRate?: number;
34
- }
35
- interface VoiceEvents {
36
- error: (error: AudioPlayerError) => any;
37
- debug: (message: string) => any;
38
- start: (resource: AudioResource<Track>) => any;
39
- finish: (resource: AudioResource<Track>) => any;
40
- dsp: (filters: PCMFilters[]) => any;
41
- eqBands: (filters: EqualizerBand[]) => any;
42
- sampleRate: (filters: number) => any;
43
- biquad: (filters: BiquadFilters) => any;
44
- volume: (volume: number) => any;
45
- destroyed: () => any;
46
- }
47
- declare class StreamDispatcher extends EventEmitter<VoiceEvents> {
48
- queue: GuildQueue;
49
- readonly connectionTimeout: number;
50
- voiceConnection: VoiceConnection;
51
- audioPlayer: AudioPlayer;
52
- receiver: VoiceReceiverNode;
53
- channel: VoiceChannel | StageChannel;
54
- audioResource?: AudioResource<Track> | null;
55
- dsp: FiltersChain;
56
- /**
57
- * Creates new connection object
58
- * @param {VoiceConnection} connection The connection
59
- * @param {VoiceChannel|StageChannel} channel The connected channel
60
- * @private
61
- */
62
- constructor(connection: VoiceConnection, channel: VoiceChannel | StageChannel, queue: GuildQueue, connectionTimeout?: number, audioPlayer?: AudioPlayer);
63
- /**
64
- * Check if the player has been paused manually
65
- */
66
- get paused(): boolean;
67
- set paused(val: boolean);
68
- /**
69
- * Whether or not the player is currently paused automatically or manually.
70
- */
71
- isPaused(): boolean;
72
- /**
73
- * Whether or not the player is currently buffering
74
- */
75
- isBuffering(): boolean;
76
- /**
77
- * Whether or not the player is currently playing
78
- */
79
- isPlaying(): boolean;
80
- /**
81
- * Whether or not the player is currently idle
82
- */
83
- isIdle(): boolean;
84
- /**
85
- * Whether or not the voice connection has been destroyed
86
- */
87
- isDestroyed(): boolean;
88
- /**
89
- * Whether or not the voice connection has been destroyed
90
- */
91
- isDisconnected(): boolean;
92
- /**
93
- * Whether or not the voice connection is ready to play
94
- */
95
- isReady(): boolean;
96
- /**
97
- * Whether or not the voice connection is signalling
98
- */
99
- isSignalling(): boolean;
100
- /**
101
- * Whether or not the voice connection is connecting
102
- */
103
- isConnecting(): boolean;
104
- /**
105
- * Creates stream
106
- * @param {Readable} src The stream source
107
- * @param {object} [ops] Options
108
- * @returns {AudioResource}
109
- */
110
- createStream(src: Readable, ops?: CreateStreamOps): Promise<AudioResource<Track<unknown>>>;
111
- get resampler(): _discord_player_equalizer.PCMResampler | null;
112
- get filters(): _discord_player_equalizer.AudioFilter | null;
113
- get biquad(): _discord_player_equalizer.BiquadStream | null;
114
- get equalizer(): _discord_player_equalizer.EqualizerStream | null;
115
- /**
116
- * The player status
117
- * @type {AudioPlayerStatus}
118
- */
119
- get status(): AudioPlayerStatus;
120
- /**
121
- * Disconnects from voice
122
- * @returns {void}
123
- */
124
- disconnect(): void;
125
- /**
126
- * Destroys this dispatcher
127
- */
128
- destroy(): void;
129
- /**
130
- * Stops the player
131
- * @returns {void}
132
- */
133
- end(): void;
134
- /**
135
- * Pauses the stream playback
136
- * @param {boolean} [interpolateSilence=false] If true, the player will play 5 packets of silence after pausing to prevent audio glitches.
137
- * @returns {boolean}
138
- */
139
- pause(interpolateSilence?: boolean): boolean;
140
- /**
141
- * Resumes the stream playback
142
- * @returns {boolean}
143
- */
144
- resume(): boolean;
145
- /**
146
- * Play stream
147
- * @param {AudioResource<Track>} [resource=this.audioResource] The audio resource to play
148
- * @returns {Promise<StreamDispatcher>}
149
- */
150
- playStream(resource?: AudioResource<Track>): Promise<this | undefined>;
151
- /**
152
- * Sets playback volume
153
- * @param {number} value The volume amount
154
- * @returns {boolean}
155
- */
156
- setVolume(value: number): boolean;
157
- /**
158
- * The current volume
159
- * @type {number}
160
- */
161
- get volume(): number;
162
- /**
163
- * The playback time
164
- * @type {number}
165
- */
166
- get streamTime(): number;
21
+ interface CreateStreamOps {
22
+ type?: StreamType;
23
+ data?: any;
24
+ disableVolume?: boolean;
25
+ disableEqualizer?: boolean;
26
+ disableBiquad?: boolean;
27
+ eq?: EqualizerBand[];
28
+ biquadFilter?: BiquadFilters;
29
+ disableFilters?: boolean;
30
+ defaultFilters?: PCMFilters[];
31
+ volume?: number;
32
+ disableResampler?: boolean;
33
+ sampleRate?: number;
34
+ }
35
+ interface VoiceEvents {
36
+ error: (error: AudioPlayerError) => any;
37
+ debug: (message: string) => any;
38
+ start: (resource: AudioResource<Track>) => any;
39
+ finish: (resource: AudioResource<Track>) => any;
40
+ dsp: (filters: PCMFilters[]) => any;
41
+ eqBands: (filters: EqualizerBand[]) => any;
42
+ sampleRate: (filters: number) => any;
43
+ biquad: (filters: BiquadFilters) => any;
44
+ volume: (volume: number) => any;
45
+ destroyed: () => any;
46
+ }
47
+ declare class StreamDispatcher extends EventEmitter<VoiceEvents> {
48
+ queue: GuildQueue;
49
+ readonly connectionTimeout: number;
50
+ voiceConnection: VoiceConnection;
51
+ audioPlayer: AudioPlayer;
52
+ receiver: VoiceReceiverNode;
53
+ channel: VoiceChannel | StageChannel;
54
+ audioResource?: AudioResource<Track> | null;
55
+ dsp: FiltersChain;
56
+ /**
57
+ * Creates new connection object
58
+ * @param {VoiceConnection} connection The connection
59
+ * @param {VoiceChannel|StageChannel} channel The connected channel
60
+ * @private
61
+ */
62
+ constructor(connection: VoiceConnection, channel: VoiceChannel | StageChannel, queue: GuildQueue, connectionTimeout?: number, audioPlayer?: AudioPlayer);
63
+ /**
64
+ * Check if the player has been paused manually
65
+ */
66
+ get paused(): boolean;
67
+ set paused(val: boolean);
68
+ /**
69
+ * Whether or not the player is currently paused automatically or manually.
70
+ */
71
+ isPaused(): boolean;
72
+ /**
73
+ * Whether or not the player is currently buffering
74
+ */
75
+ isBuffering(): boolean;
76
+ /**
77
+ * Whether or not the player is currently playing
78
+ */
79
+ isPlaying(): boolean;
80
+ /**
81
+ * Whether or not the player is currently idle
82
+ */
83
+ isIdle(): boolean;
84
+ /**
85
+ * Whether or not the voice connection has been destroyed
86
+ */
87
+ isDestroyed(): boolean;
88
+ /**
89
+ * Whether or not the voice connection has been destroyed
90
+ */
91
+ isDisconnected(): boolean;
92
+ /**
93
+ * Whether or not the voice connection is ready to play
94
+ */
95
+ isReady(): boolean;
96
+ /**
97
+ * Whether or not the voice connection is signalling
98
+ */
99
+ isSignalling(): boolean;
100
+ /**
101
+ * Whether or not the voice connection is connecting
102
+ */
103
+ isConnecting(): boolean;
104
+ /**
105
+ * Creates stream
106
+ * @param {Readable} src The stream source
107
+ * @param {object} [ops] Options
108
+ * @returns {AudioResource}
109
+ */
110
+ createStream(src: Readable, ops?: CreateStreamOps): Promise<AudioResource<Track<unknown>>>;
111
+ get resampler(): _discord_player_equalizer.PCMResampler | null;
112
+ get filters(): _discord_player_equalizer.AudioFilter | null;
113
+ get biquad(): _discord_player_equalizer.BiquadStream | null;
114
+ get equalizer(): _discord_player_equalizer.EqualizerStream | null;
115
+ /**
116
+ * The player status
117
+ * @type {AudioPlayerStatus}
118
+ */
119
+ get status(): AudioPlayerStatus;
120
+ /**
121
+ * Disconnects from voice
122
+ * @returns {void}
123
+ */
124
+ disconnect(): void;
125
+ /**
126
+ * Destroys this dispatcher
127
+ */
128
+ destroy(): void;
129
+ /**
130
+ * Stops the player
131
+ * @returns {void}
132
+ */
133
+ end(): void;
134
+ /**
135
+ * Pauses the stream playback
136
+ * @param {boolean} [interpolateSilence=false] If true, the player will play 5 packets of silence after pausing to prevent audio glitches.
137
+ * @returns {boolean}
138
+ */
139
+ pause(interpolateSilence?: boolean): boolean;
140
+ /**
141
+ * Resumes the stream playback
142
+ * @returns {boolean}
143
+ */
144
+ resume(): boolean;
145
+ /**
146
+ * Play stream
147
+ * @param {AudioResource<Track>} [resource=this.audioResource] The audio resource to play
148
+ * @returns {Promise<StreamDispatcher>}
149
+ */
150
+ playStream(resource?: AudioResource<Track>): Promise<this | undefined>;
151
+ /**
152
+ * Sets playback volume
153
+ * @param {number} value The volume amount
154
+ * @returns {boolean}
155
+ */
156
+ setVolume(value: number): boolean;
157
+ /**
158
+ * The current volume
159
+ * @type {number}
160
+ */
161
+ get volume(): number;
162
+ /**
163
+ * The playback time
164
+ * @type {number}
165
+ */
166
+ get streamTime(): number;
167
167
  }
168
168
 
169
- interface VoiceReceiverOptions {
170
- mode?: 'opus' | 'pcm';
171
- end?: EndBehaviorType;
172
- silenceDuration?: number;
173
- crc?: boolean;
174
- }
175
- type RawTrackInit = Partial<Omit<RawTrackData, 'author' | 'playlist' | 'source' | 'engine' | 'raw' | 'queryType' | 'description' | 'views'>>;
176
- declare class VoiceReceiverNode {
177
- dispatcher: StreamDispatcher;
178
- constructor(dispatcher: StreamDispatcher);
179
- createRawTrack(stream: Readable, data?: RawTrackInit): Track<unknown>;
180
- /**
181
- * Merge multiple streams together
182
- * @param streams The array of streams to merge
183
- */
184
- mergeRecordings(streams: Readable[]): void;
185
- /**
186
- * Record a user in voice channel
187
- * @param user The user to record
188
- * @param options Recording options
189
- */
190
- recordUser(user: UserResolvable, options?: VoiceReceiverOptions): Readable;
169
+ interface VoiceReceiverOptions {
170
+ mode?: 'opus' | 'pcm';
171
+ end?: EndBehaviorType;
172
+ silenceDuration?: number;
173
+ crc?: boolean;
174
+ }
175
+ type RawTrackInit = Partial<Omit<RawTrackData, 'author' | 'playlist' | 'source' | 'engine' | 'raw' | 'queryType' | 'description' | 'views'>>;
176
+ declare class VoiceReceiverNode {
177
+ dispatcher: StreamDispatcher;
178
+ constructor(dispatcher: StreamDispatcher);
179
+ createRawTrack(stream: Readable, data?: RawTrackInit): Track<unknown>;
180
+ /**
181
+ * Merge multiple streams together
182
+ * @param streams The array of streams to merge
183
+ */
184
+ mergeRecordings(streams: Readable[]): void;
185
+ /**
186
+ * Record a user in voice channel
187
+ * @param user The user to record
188
+ * @param options Recording options
189
+ */
190
+ recordUser(user: UserResolvable, options?: VoiceReceiverOptions): Readable;
191
191
  }
192
192
 
193
- declare class GuildQueueHistory<Meta = unknown> {
194
- queue: GuildQueue<Meta>;
195
- tracks: Queue<Track<unknown>>;
196
- constructor(queue: GuildQueue<Meta>);
197
- /**
198
- * Current track in the queue
199
- */
200
- get currentTrack(): Track<unknown> | null;
201
- /**
202
- * Next track in the queue
203
- */
204
- get nextTrack(): Track<unknown> | null;
205
- /**
206
- * Previous track in the queue
207
- */
208
- get previousTrack(): Track<unknown> | null;
209
- /**
210
- * If history is disabled
211
- */
212
- get disabled(): boolean;
213
- /**
214
- * Gets the size of the queue
215
- */
216
- get size(): number;
217
- getSize(): number;
218
- /**
219
- * If history is empty
220
- */
221
- isEmpty(): boolean;
222
- /**
223
- * Add track to track history
224
- * @param track The track to add
225
- */
226
- push(track: Track | Track[]): boolean;
227
- /**
228
- * Clear history
229
- */
230
- clear(): void;
231
- /**
232
- * Play the next track in the queue
233
- */
234
- next(): Promise<void>;
235
- /**
236
- * Play the previous track in the queue
237
- */
238
- previous(preserveCurrent?: boolean): Promise<void>;
239
- /**
240
- * Alias to [GuildQueueHistory].previous()
241
- */
242
- back(preserveCurrent?: boolean): Promise<void>;
243
- /**
244
- * Resize history store
245
- */
246
- resize(): void;
193
+ declare class GuildQueueHistory<Meta = unknown> {
194
+ queue: GuildQueue<Meta>;
195
+ tracks: Queue<Track<unknown>>;
196
+ constructor(queue: GuildQueue<Meta>);
197
+ /**
198
+ * Current track in the queue
199
+ */
200
+ get currentTrack(): Track<unknown> | null;
201
+ /**
202
+ * Next track in the queue
203
+ */
204
+ get nextTrack(): Track<unknown> | null;
205
+ /**
206
+ * Previous track in the queue
207
+ */
208
+ get previousTrack(): Track<unknown> | null;
209
+ /**
210
+ * If history is disabled
211
+ */
212
+ get disabled(): boolean;
213
+ /**
214
+ * Gets the size of the queue
215
+ */
216
+ get size(): number;
217
+ getSize(): number;
218
+ /**
219
+ * If history is empty
220
+ */
221
+ isEmpty(): boolean;
222
+ /**
223
+ * Add track to track history
224
+ * @param track The track to add
225
+ */
226
+ push(track: Track | Track[]): boolean;
227
+ /**
228
+ * Clear history
229
+ */
230
+ clear(): void;
231
+ /**
232
+ * Play the next track in the queue
233
+ */
234
+ next(): Promise<void>;
235
+ /**
236
+ * Play the previous track in the queue
237
+ */
238
+ previous(preserveCurrent?: boolean): Promise<void>;
239
+ /**
240
+ * Alias to [GuildQueueHistory].previous()
241
+ */
242
+ back(preserveCurrent?: boolean): Promise<void>;
243
+ /**
244
+ * Resize history store
245
+ */
246
+ resize(): void;
247
247
  }
248
248
 
249
- interface AsyncQueueAcquisitionOptions {
250
- /**
251
- * AbortSignal to cancel this entry
252
- */
253
- signal?: AbortSignal;
254
- }
255
- type AsyncQueueExceptionHandler = (exception: Error) => void;
256
- declare class AsyncQueue {
257
- /**
258
- * The queued entries
259
- */
260
- entries: Array<AsyncQueueEntry>;
261
- exceptionHandler?: AsyncQueueExceptionHandler;
262
- /**
263
- * Clear entries queue
264
- * @param consume Whether or not to consume all entries before clearing
265
- */
266
- clear(consume?: boolean): void;
267
- /**
268
- * The total number of entries in this queue. Returns `0` if no entries are available.
269
- */
270
- get size(): number;
271
- /**
272
- * Acquire an entry.
273
- *
274
- * @example // lock the queue
275
- * const entry = asyncQueue.acquire();
276
- * // wait until previous task is completed
277
- * await entry.getTask();
278
- * // do something expensive
279
- * await performSomethingExpensive();
280
- * // make sure to release the lock once done
281
- * asyncQueue.release();
282
- *
283
- */
284
- acquire(options?: AsyncQueueAcquisitionOptions): AsyncQueueEntry;
285
- /**
286
- * Release the current acquisition and move to next entry.
287
- */
288
- release(): void;
289
- /**
290
- * Cancel all entries
291
- */
292
- cancelAll(): void;
293
- /**
294
- * Remove the given entry from the queue
295
- * @param entry The entry to remove
296
- */
297
- removeEntry(entry: AsyncQueueEntry): boolean;
298
- }
299
- declare class AsyncQueueEntry {
300
- queue: AsyncQueue;
301
- options?: AsyncQueueAcquisitionOptions | undefined;
302
- readonly id: string;
303
- private readonly promise;
304
- signal: AbortSignal | null;
305
- onAbort: (() => void) | null;
306
- private resolve;
307
- private reject;
308
- constructor(queue: AsyncQueue, options?: AsyncQueueAcquisitionOptions | undefined);
309
- setAbortSignal(signal: AbortSignal): void;
310
- consume(): void;
311
- release(): void;
312
- cancel(): void;
313
- cleanup(): void;
314
- getTask(): Promise<void>;
249
+ interface AsyncQueueAcquisitionOptions {
250
+ /**
251
+ * AbortSignal to cancel this entry
252
+ */
253
+ signal?: AbortSignal;
254
+ }
255
+ type AsyncQueueExceptionHandler = (exception: Error) => void;
256
+ declare class AsyncQueue {
257
+ /**
258
+ * The queued entries
259
+ */
260
+ entries: Array<AsyncQueueEntry>;
261
+ exceptionHandler?: AsyncQueueExceptionHandler;
262
+ /**
263
+ * Clear entries queue
264
+ * @param consume Whether or not to consume all entries before clearing
265
+ */
266
+ clear(consume?: boolean): void;
267
+ /**
268
+ * The total number of entries in this queue. Returns `0` if no entries are available.
269
+ */
270
+ get size(): number;
271
+ /**
272
+ * Acquire an entry.
273
+ *
274
+ * @example // lock the queue
275
+ * const entry = asyncQueue.acquire();
276
+ * // wait until previous task is completed
277
+ * await entry.getTask();
278
+ * // do something expensive
279
+ * await performSomethingExpensive();
280
+ * // make sure to release the lock once done
281
+ * asyncQueue.release();
282
+ *
283
+ */
284
+ acquire(options?: AsyncQueueAcquisitionOptions): AsyncQueueEntry;
285
+ /**
286
+ * Release the current acquisition and move to next entry.
287
+ */
288
+ release(): void;
289
+ /**
290
+ * Cancel all entries
291
+ */
292
+ cancelAll(): void;
293
+ /**
294
+ * Remove the given entry from the queue
295
+ * @param entry The entry to remove
296
+ */
297
+ removeEntry(entry: AsyncQueueEntry): boolean;
298
+ }
299
+ declare class AsyncQueueEntry {
300
+ queue: AsyncQueue;
301
+ options?: AsyncQueueAcquisitionOptions | undefined;
302
+ readonly id: string;
303
+ private readonly promise;
304
+ signal: AbortSignal | null;
305
+ onAbort: (() => void) | null;
306
+ private resolve;
307
+ private reject;
308
+ constructor(queue: AsyncQueue, options?: AsyncQueueAcquisitionOptions | undefined);
309
+ setAbortSignal(signal: AbortSignal): void;
310
+ consume(): void;
311
+ release(): void;
312
+ cancel(): void;
313
+ cleanup(): void;
314
+ getTask(): Promise<void>;
315
315
  }
316
316
 
317
- declare const FFMPEG_SRATE_REGEX: RegExp;
318
- interface ResourcePlayOptions {
319
- queue?: boolean;
320
- seek?: number;
321
- transitionMode?: boolean;
322
- }
323
- interface PlayerTimestamp {
324
- current: {
325
- label: string;
326
- value: number;
327
- };
328
- total: {
329
- label: string;
330
- value: number;
331
- };
332
- progress: number;
333
- }
334
- interface StreamConfig {
335
- dispatcherConfig: CreateStreamOps;
336
- playerConfig: ResourcePlayOptions;
337
- }
338
- declare class GuildQueuePlayerNode<Meta = unknown> {
339
- #private;
340
- queue: GuildQueue<Meta>;
341
- tasksQueue: AsyncQueue;
342
- constructor(queue: GuildQueue<Meta>);
343
- /**
344
- * If the player is currently in idle mode
345
- */
346
- isIdle(): boolean;
347
- /**
348
- * If the player is currently buffering the track
349
- */
350
- isBuffering(): boolean;
351
- /**
352
- * If the player is currently playing a track
353
- */
354
- isPlaying(): boolean;
355
- /**
356
- * If the player is currently paused
357
- */
358
- isPaused(): boolean;
359
- /**
360
- * Reset progress history
361
- */
362
- resetProgress(): void;
363
- /**
364
- * Set player progress
365
- */
366
- setProgress(progress: number): void;
367
- /**
368
- * The stream time for current session
369
- */
370
- get streamTime(): number;
371
- /**
372
- * Current playback duration with history included
373
- */
374
- get playbackTime(): number;
375
- /**
376
- * Get duration multiplier
377
- */
378
- getDurationMultiplier(): number;
379
- /**
380
- * Estimated progress of the player
381
- */
382
- get estimatedPlaybackTime(): number;
383
- /**
384
- * Estimated total duration of the player
385
- */
386
- get estimatedDuration(): number;
387
- /**
388
- * Total duration of the current audio track
389
- */
390
- get totalDuration(): number;
391
- /**
392
- * Get stream progress
393
- * @param ignoreFilters Ignore filters
394
- */
395
- getTimestamp(ignoreFilters?: boolean): PlayerTimestamp | null;
396
- /**
397
- * Create progress bar for current progress
398
- * @param options Progress bar options
399
- */
400
- createProgressBar(options?: PlayerProgressbarOptions): string | null;
401
- /**
402
- * Seek the player
403
- * @param duration The duration to seek to
404
- */
405
- seek(duration: number): Promise<boolean>;
406
- /**
407
- * Current volume
408
- */
409
- get volume(): number;
410
- /**
411
- * Set volume
412
- * @param vol Volume amount to set
413
- */
414
- setVolume(vol: number): boolean;
415
- /**
416
- * Set bit rate
417
- * @param rate The bit rate to set
418
- */
419
- setBitrate(rate: number | 'auto'): void;
420
- /**
421
- * Set paused state
422
- * @param state The state
423
- */
424
- setPaused(state: boolean): boolean;
425
- /**
426
- * Pause the playback
427
- */
428
- pause(): boolean;
429
- /**
430
- * Resume the playback
431
- */
432
- resume(): boolean;
433
- /**
434
- * Skip current track
435
- */
436
- skip(): boolean;
437
- /**
438
- * Remove the given track from queue
439
- * @param track The track to remove
440
- */
441
- remove(track: TrackResolvable): Track<unknown> | null;
442
- /**
443
- * Jump to specific track on the queue
444
- * @param track The track to jump to without removing other tracks
445
- */
446
- jump(track: TrackResolvable): boolean;
447
- /**
448
- * Get track position
449
- * @param track The track
450
- */
451
- getTrackPosition(track: TrackResolvable): number;
452
- /**
453
- * Skip to the given track, removing others on the way
454
- * @param track The track to skip to
455
- */
456
- skipTo(track: TrackResolvable): boolean;
457
- /**
458
- * Insert a track on the given position in queue
459
- * @param track The track to insert
460
- * @param index The position to insert to, defaults to 0.
461
- */
462
- insert(track: Track, index?: number): void;
463
- /**
464
- * Moves a track in the queue
465
- * @param from The track to move
466
- * @param to The position to move to
467
- */
468
- move(from: TrackResolvable, to: number): void;
469
- /**
470
- * Copy a track in the queue
471
- * @param from The track to clone
472
- * @param to The position to clone at
473
- */
474
- copy(from: TrackResolvable, to: number): void;
475
- /**
476
- * Swap two tracks in the queue
477
- * @param first The first track to swap
478
- * @param second The second track to swap
479
- */
480
- swap(first: TrackResolvable, second: TrackResolvable): void;
481
- /**
482
- * Stop the playback
483
- * @param force Whether or not to forcefully stop the playback
484
- */
485
- stop(force?: boolean): boolean;
486
- /**
487
- * Play raw audio resource
488
- * @param resource The audio resource to play
489
- */
490
- playRaw(resource: AudioResource): Promise<void>;
491
- /**
492
- * Play the given track
493
- * @param res The track to play
494
- * @param options Options for playing the track
495
- */
496
- play(res?: Track | null, options?: ResourcePlayOptions): Promise<void>;
317
+ declare const FFMPEG_SRATE_REGEX: RegExp;
318
+ interface ResourcePlayOptions {
319
+ queue?: boolean;
320
+ seek?: number;
321
+ transitionMode?: boolean;
322
+ }
323
+ interface PlayerTimestamp {
324
+ current: {
325
+ label: string;
326
+ value: number;
327
+ };
328
+ total: {
329
+ label: string;
330
+ value: number;
331
+ };
332
+ progress: number;
333
+ }
334
+ interface StreamConfig {
335
+ dispatcherConfig: CreateStreamOps;
336
+ playerConfig: ResourcePlayOptions;
337
+ }
338
+ declare class GuildQueuePlayerNode<Meta = unknown> {
339
+ #private;
340
+ queue: GuildQueue<Meta>;
341
+ tasksQueue: AsyncQueue;
342
+ constructor(queue: GuildQueue<Meta>);
343
+ /**
344
+ * If the player is currently in idle mode
345
+ */
346
+ isIdle(): boolean;
347
+ /**
348
+ * If the player is currently buffering the track
349
+ */
350
+ isBuffering(): boolean;
351
+ /**
352
+ * If the player is currently playing a track
353
+ */
354
+ isPlaying(): boolean;
355
+ /**
356
+ * If the player is currently paused
357
+ */
358
+ isPaused(): boolean;
359
+ /**
360
+ * Reset progress history
361
+ */
362
+ resetProgress(): void;
363
+ /**
364
+ * Set player progress
365
+ */
366
+ setProgress(progress: number): void;
367
+ /**
368
+ * The stream time for current session
369
+ */
370
+ get streamTime(): number;
371
+ /**
372
+ * Current playback duration with history included
373
+ */
374
+ get playbackTime(): number;
375
+ /**
376
+ * Get duration multiplier
377
+ */
378
+ getDurationMultiplier(): number;
379
+ /**
380
+ * Estimated progress of the player
381
+ */
382
+ get estimatedPlaybackTime(): number;
383
+ /**
384
+ * Estimated total duration of the player
385
+ */
386
+ get estimatedDuration(): number;
387
+ /**
388
+ * Total duration of the current audio track
389
+ */
390
+ get totalDuration(): number;
391
+ /**
392
+ * Get stream progress
393
+ * @param ignoreFilters Ignore filters
394
+ */
395
+ getTimestamp(ignoreFilters?: boolean): PlayerTimestamp | null;
396
+ /**
397
+ * Create progress bar for current progress
398
+ * @param options Progress bar options
399
+ */
400
+ createProgressBar(options?: PlayerProgressbarOptions): string | null;
401
+ /**
402
+ * Seek the player
403
+ * @param duration The duration to seek to
404
+ */
405
+ seek(duration: number): Promise<boolean>;
406
+ /**
407
+ * Current volume
408
+ */
409
+ get volume(): number;
410
+ /**
411
+ * Set volume
412
+ * @param vol Volume amount to set
413
+ */
414
+ setVolume(vol: number): boolean;
415
+ /**
416
+ * Set bit rate
417
+ * @param rate The bit rate to set
418
+ */
419
+ setBitrate(rate: number | 'auto'): void;
420
+ /**
421
+ * Set paused state
422
+ * @param state The state
423
+ */
424
+ setPaused(state: boolean): boolean;
425
+ /**
426
+ * Pause the playback
427
+ */
428
+ pause(): boolean;
429
+ /**
430
+ * Resume the playback
431
+ */
432
+ resume(): boolean;
433
+ /**
434
+ * Skip current track
435
+ */
436
+ skip(): boolean;
437
+ /**
438
+ * Remove the given track from queue
439
+ * @param track The track to remove
440
+ */
441
+ remove(track: TrackResolvable): Track<unknown> | null;
442
+ /**
443
+ * Jump to specific track on the queue
444
+ * @param track The track to jump to without removing other tracks
445
+ */
446
+ jump(track: TrackResolvable): boolean;
447
+ /**
448
+ * Get track position
449
+ * @param track The track
450
+ */
451
+ getTrackPosition(track: TrackResolvable): number;
452
+ /**
453
+ * Skip to the given track, removing others on the way
454
+ * @param track The track to skip to
455
+ */
456
+ skipTo(track: TrackResolvable): boolean;
457
+ /**
458
+ * Insert a track on the given position in queue
459
+ * @param track The track to insert
460
+ * @param index The position to insert to, defaults to 0.
461
+ */
462
+ insert(track: Track, index?: number): void;
463
+ /**
464
+ * Moves a track in the queue
465
+ * @param from The track to move
466
+ * @param to The position to move to
467
+ */
468
+ move(from: TrackResolvable, to: number): void;
469
+ /**
470
+ * Copy a track in the queue
471
+ * @param from The track to clone
472
+ * @param to The position to clone at
473
+ */
474
+ copy(from: TrackResolvable, to: number): void;
475
+ /**
476
+ * Swap two tracks in the queue
477
+ * @param first The first track to swap
478
+ * @param second The second track to swap
479
+ */
480
+ swap(first: TrackResolvable, second: TrackResolvable): void;
481
+ /**
482
+ * Stop the playback
483
+ * @param force Whether or not to forcefully stop the playback
484
+ */
485
+ stop(force?: boolean): boolean;
486
+ /**
487
+ * Play raw audio resource
488
+ * @param resource The audio resource to play
489
+ */
490
+ playRaw(resource: AudioResource): Promise<void>;
491
+ /**
492
+ * Play the given track
493
+ * @param res The track to play
494
+ * @param options Options for playing the track
495
+ */
496
+ play(res?: Track | null, options?: ResourcePlayOptions): Promise<void>;
497
497
  }
498
498
 
499
- interface FFmpegStreamOptions {
500
- fmt?: string;
501
- encoderArgs?: string[];
502
- seek?: number;
503
- skip?: boolean;
504
- cookies?: string;
505
- useLegacyFFmpeg?: boolean;
506
- }
507
- declare function FFMPEG_ARGS_STRING(stream: string, fmt?: string, cookies?: string): string[];
508
- declare function FFMPEG_ARGS_PIPED(fmt?: string): string[];
509
- /**
510
- * Creates FFmpeg stream
511
- * @param stream The source stream
512
- * @param options FFmpeg stream options
513
- */
499
+ interface FFmpegStreamOptions {
500
+ fmt?: string;
501
+ encoderArgs?: string[];
502
+ seek?: number;
503
+ skip?: boolean;
504
+ cookies?: string;
505
+ useLegacyFFmpeg?: boolean;
506
+ }
507
+ declare function FFMPEG_ARGS_STRING(stream: string, fmt?: string, cookies?: string): string[];
508
+ declare function FFMPEG_ARGS_PIPED(fmt?: string): string[];
509
+ /**
510
+ * Creates FFmpeg stream
511
+ * @param stream The source stream
512
+ * @param options FFmpeg stream options
513
+ */
514
514
  declare function createFFmpegStream(stream: Readable | Duplex | string, options?: FFmpegStreamOptions): Readable;
515
515
 
516
- type Filters = keyof typeof AudioFilters.filters;
517
- type EQPreset = {
518
- Flat: EqualizerBand[];
519
- Classical: EqualizerBand[];
520
- Club: EqualizerBand[];
521
- Dance: EqualizerBand[];
522
- FullBass: EqualizerBand[];
523
- FullBassTreble: EqualizerBand[];
524
- FullTreble: EqualizerBand[];
525
- Headphones: EqualizerBand[];
526
- LargeHall: EqualizerBand[];
527
- Live: EqualizerBand[];
528
- Party: EqualizerBand[];
529
- Pop: EqualizerBand[];
530
- Reggae: EqualizerBand[];
531
- Rock: EqualizerBand[];
532
- Ska: EqualizerBand[];
533
- Soft: EqualizerBand[];
534
- SoftRock: EqualizerBand[];
535
- Techno: EqualizerBand[];
536
- };
537
- declare const EqualizerConfigurationPreset: Readonly<EQPreset>;
538
- declare class FFmpegFilterer<Meta = unknown> {
539
- #private;
540
- af: GuildQueueAudioFilters<Meta>;
541
- constructor(af: GuildQueueAudioFilters<Meta>);
542
- /**
543
- * Set input args for FFmpeg
544
- */
545
- setInputArgs(args: string[]): void;
546
- /**
547
- * Get input args
548
- */
549
- get inputArgs(): string[];
550
- /**
551
- * Get encoder args
552
- */
553
- get encoderArgs(): string[];
554
- /**
555
- * Get final ffmpeg args
556
- */
557
- get args(): string[];
558
- /**
559
- * Create ffmpeg stream
560
- * @param source The stream source
561
- * @param options The stream options
562
- */
563
- createStream(source: string | Readable, options: FFmpegStreamOptions): Readable;
564
- /**
565
- * Set ffmpeg filters
566
- * @param filters The filters
567
- */
568
- setFilters(filters: Filters[] | Record<Filters, boolean> | boolean): Promise<boolean>;
569
- /**
570
- * Currently active ffmpeg filters
571
- */
572
- get filters(): Filters[];
573
- set filters(filters: Filters[]);
574
- /**
575
- * Toggle given ffmpeg filter(s)
576
- * @param filters The filter(s)
577
- */
578
- toggle(filters: Filters[] | Filters): Promise<boolean>;
579
- /**
580
- * Set default filters
581
- * @param ff Filters list
582
- */
583
- setDefaults(ff: Filters[]): void;
584
- /**
585
- * Get list of enabled filters
586
- */
587
- getFiltersEnabled(): (keyof QueueFilters)[];
588
- /**
589
- * Get list of disabled filters
590
- */
591
- getFiltersDisabled(): (keyof QueueFilters)[];
592
- /**
593
- * Check if the given filter is enabled
594
- * @param filter The filter
595
- */
596
- isEnabled<T extends Filters>(filter: T): boolean;
597
- /**
598
- * Check if the given filter is disabled
599
- * @param filter The filter
600
- */
601
- isDisabled<T extends Filters>(filter: T): boolean;
602
- /**
603
- * Check if the given filter is a valid filter
604
- * @param filter The filter to test
605
- */
606
- isValidFilter(filter: string): filter is FiltersName;
607
- /**
608
- * Convert current filters to array
609
- */
610
- toArray(): string[];
611
- /**
612
- * Convert current filters to JSON object
613
- */
614
- toJSON(): Record<keyof QueueFilters, string>;
615
- /**
616
- * String representation of current filters
617
- */
618
- toString(): string;
619
- }
620
- interface GuildQueueAFiltersCache {
621
- equalizer: EqualizerBand[];
622
- biquad: BiquadFilters | null;
623
- filters: PCMFilters[];
624
- volume: number;
625
- sampleRate: number;
626
- }
627
- declare class GuildQueueAudioFilters<Meta = unknown> {
628
- queue: GuildQueue<Meta>;
629
- graph: AFilterGraph<Meta>;
630
- ffmpeg: FFmpegFilterer<Meta>;
631
- equalizerPresets: Readonly<EQPreset>;
632
- _lastFiltersCache: GuildQueueAFiltersCache;
633
- constructor(queue: GuildQueue<Meta>);
634
- /**
635
- * Volume transformer
636
- */
637
- get volume(): _discord_player_equalizer.VolumeTransformer | null;
638
- /**
639
- * 15 Band Equalizer
640
- */
641
- get equalizer(): _discord_player_equalizer.EqualizerStream | null;
642
- /**
643
- * Digital biquad filters
644
- */
645
- get biquad(): _discord_player_equalizer.BiquadStream | null;
646
- /**
647
- * DSP filters
648
- */
649
- get filters(): _discord_player_equalizer.AudioFilter | null;
650
- /**
651
- * Audio resampler
652
- */
653
- get resampler(): _discord_player_equalizer.PCMResampler | null;
654
- /**
655
- * Replay current track in transition mode
656
- * @param seek The duration to seek to
657
- */
658
- triggerReplay(seek?: number): Promise<boolean>;
659
- }
660
- declare class AFilterGraph<Meta = unknown> {
661
- af: GuildQueueAudioFilters<Meta>;
662
- constructor(af: GuildQueueAudioFilters<Meta>);
663
- get ffmpeg(): (keyof QueueFilters)[];
664
- get equalizer(): EqualizerBand[];
665
- get biquad(): null;
666
- get filters(): ("8D" | "Tremolo" | "Vibrato")[];
667
- get volume(): _discord_player_equalizer.VolumeTransformer | null;
668
- get resampler(): _discord_player_equalizer.PCMResampler | null;
669
- dump(): FilterGraph;
670
- }
671
- interface FilterGraph {
672
- ffmpeg: Filters[];
673
- equalizer: EqualizerBand[];
674
- biquad: Exclude<BiquadFilters, number> | null;
675
- filters: PCMFilters[];
676
- volume: number;
677
- sampleRate: number;
516
+ type Filters = keyof typeof AudioFilters.filters;
517
+ type EQPreset = {
518
+ Flat: EqualizerBand[];
519
+ Classical: EqualizerBand[];
520
+ Club: EqualizerBand[];
521
+ Dance: EqualizerBand[];
522
+ FullBass: EqualizerBand[];
523
+ FullBassTreble: EqualizerBand[];
524
+ FullTreble: EqualizerBand[];
525
+ Headphones: EqualizerBand[];
526
+ LargeHall: EqualizerBand[];
527
+ Live: EqualizerBand[];
528
+ Party: EqualizerBand[];
529
+ Pop: EqualizerBand[];
530
+ Reggae: EqualizerBand[];
531
+ Rock: EqualizerBand[];
532
+ Ska: EqualizerBand[];
533
+ Soft: EqualizerBand[];
534
+ SoftRock: EqualizerBand[];
535
+ Techno: EqualizerBand[];
536
+ };
537
+ declare const EqualizerConfigurationPreset: Readonly<EQPreset>;
538
+ declare class FFmpegFilterer<Meta = unknown> {
539
+ #private;
540
+ af: GuildQueueAudioFilters<Meta>;
541
+ constructor(af: GuildQueueAudioFilters<Meta>);
542
+ /**
543
+ * Set input args for FFmpeg
544
+ */
545
+ setInputArgs(args: string[]): void;
546
+ /**
547
+ * Get input args
548
+ */
549
+ get inputArgs(): string[];
550
+ /**
551
+ * Get encoder args
552
+ */
553
+ get encoderArgs(): string[];
554
+ /**
555
+ * Get final ffmpeg args
556
+ */
557
+ get args(): string[];
558
+ /**
559
+ * Create ffmpeg stream
560
+ * @param source The stream source
561
+ * @param options The stream options
562
+ */
563
+ createStream(source: string | Readable, options: FFmpegStreamOptions): Readable;
564
+ /**
565
+ * Set ffmpeg filters
566
+ * @param filters The filters
567
+ */
568
+ setFilters(filters: Filters[] | Record<Filters, boolean> | boolean): Promise<boolean>;
569
+ /**
570
+ * Currently active ffmpeg filters
571
+ */
572
+ get filters(): Filters[];
573
+ set filters(filters: Filters[]);
574
+ /**
575
+ * Toggle given ffmpeg filter(s)
576
+ * @param filters The filter(s)
577
+ */
578
+ toggle(filters: Filters[] | Filters): Promise<boolean>;
579
+ /**
580
+ * Set default filters
581
+ * @param ff Filters list
582
+ */
583
+ setDefaults(ff: Filters[]): void;
584
+ /**
585
+ * Get list of enabled filters
586
+ */
587
+ getFiltersEnabled(): (keyof QueueFilters)[];
588
+ /**
589
+ * Get list of disabled filters
590
+ */
591
+ getFiltersDisabled(): (keyof QueueFilters)[];
592
+ /**
593
+ * Check if the given filter is enabled
594
+ * @param filter The filter
595
+ */
596
+ isEnabled<T extends Filters>(filter: T): boolean;
597
+ /**
598
+ * Check if the given filter is disabled
599
+ * @param filter The filter
600
+ */
601
+ isDisabled<T extends Filters>(filter: T): boolean;
602
+ /**
603
+ * Check if the given filter is a valid filter
604
+ * @param filter The filter to test
605
+ */
606
+ isValidFilter(filter: string): filter is FiltersName;
607
+ /**
608
+ * Convert current filters to array
609
+ */
610
+ toArray(): string[];
611
+ /**
612
+ * Convert current filters to JSON object
613
+ */
614
+ toJSON(): Record<keyof QueueFilters, string>;
615
+ /**
616
+ * String representation of current filters
617
+ */
618
+ toString(): string;
619
+ }
620
+ interface GuildQueueAFiltersCache {
621
+ equalizer: EqualizerBand[];
622
+ biquad: BiquadFilters | null;
623
+ filters: PCMFilters[];
624
+ volume: number;
625
+ sampleRate: number;
626
+ }
627
+ declare class GuildQueueAudioFilters<Meta = unknown> {
628
+ queue: GuildQueue<Meta>;
629
+ graph: AFilterGraph<Meta>;
630
+ ffmpeg: FFmpegFilterer<Meta>;
631
+ equalizerPresets: Readonly<EQPreset>;
632
+ _lastFiltersCache: GuildQueueAFiltersCache;
633
+ constructor(queue: GuildQueue<Meta>);
634
+ /**
635
+ * Volume transformer
636
+ */
637
+ get volume(): _discord_player_equalizer.VolumeTransformer | null;
638
+ /**
639
+ * 15 Band Equalizer
640
+ */
641
+ get equalizer(): _discord_player_equalizer.EqualizerStream | null;
642
+ /**
643
+ * Digital biquad filters
644
+ */
645
+ get biquad(): _discord_player_equalizer.BiquadStream | null;
646
+ /**
647
+ * DSP filters
648
+ */
649
+ get filters(): _discord_player_equalizer.AudioFilter | null;
650
+ /**
651
+ * Audio resampler
652
+ */
653
+ get resampler(): _discord_player_equalizer.PCMResampler | null;
654
+ /**
655
+ * Replay current track in transition mode
656
+ * @param seek The duration to seek to
657
+ */
658
+ triggerReplay(seek?: number): Promise<boolean>;
659
+ }
660
+ declare class AFilterGraph<Meta = unknown> {
661
+ af: GuildQueueAudioFilters<Meta>;
662
+ constructor(af: GuildQueueAudioFilters<Meta>);
663
+ get ffmpeg(): (keyof QueueFilters)[];
664
+ get equalizer(): EqualizerBand[];
665
+ get biquad(): null;
666
+ get filters(): ("8D" | "Tremolo" | "Vibrato")[];
667
+ get volume(): _discord_player_equalizer.VolumeTransformer | null;
668
+ get resampler(): _discord_player_equalizer.PCMResampler | null;
669
+ dump(): FilterGraph;
670
+ }
671
+ interface FilterGraph {
672
+ ffmpeg: Filters[];
673
+ equalizer: EqualizerBand[];
674
+ biquad: Exclude<BiquadFilters, number> | null;
675
+ filters: PCMFilters[];
676
+ volume: number;
677
+ sampleRate: number;
678
678
  }
679
679
 
680
- interface GuildQueueStatisticsMetadata {
681
- latency: {
682
- eventLoop: number;
683
- voiceConnection: number;
684
- };
685
- status: {
686
- buffering: boolean;
687
- playing: boolean;
688
- paused: boolean;
689
- idle: boolean;
690
- };
691
- tracksCount: number;
692
- historySize: number;
693
- extractors: number;
694
- listeners: number;
695
- memoryUsage: NodeJS.MemoryUsage;
696
- versions: {
697
- node: string;
698
- player: string;
699
- };
700
- }
701
- declare class GuildQueueStatistics<Meta = unknown> {
702
- queue: GuildQueue<Meta>;
703
- constructor(queue: GuildQueue<Meta>);
704
- /**
705
- * Generate statistics of this queue
706
- */
707
- generate(): GuildQueueStatisticsMetadata;
680
+ interface GuildQueueStatisticsMetadata {
681
+ latency: {
682
+ eventLoop: number;
683
+ voiceConnection: number;
684
+ };
685
+ status: {
686
+ buffering: boolean;
687
+ playing: boolean;
688
+ paused: boolean;
689
+ idle: boolean;
690
+ };
691
+ tracksCount: number;
692
+ historySize: number;
693
+ extractors: number;
694
+ listeners: number;
695
+ memoryUsage: NodeJS.MemoryUsage;
696
+ versions: {
697
+ node: string;
698
+ player: string;
699
+ };
700
+ }
701
+ declare class GuildQueueStatistics<Meta = unknown> {
702
+ queue: GuildQueue<Meta>;
703
+ constructor(queue: GuildQueue<Meta>);
704
+ /**
705
+ * Generate statistics of this queue
706
+ */
707
+ generate(): GuildQueueStatisticsMetadata;
708
708
  }
709
709
 
710
- interface GuildNodeInit<Meta = unknown> {
711
- guild: Guild;
712
- queueStrategy: QueueStrategy;
713
- equalizer: EqualizerBand[] | boolean;
714
- volume: number | boolean;
715
- biquad: BiquadFilters | boolean | undefined;
716
- resampler: number | boolean;
717
- filterer: PCMFilters[] | boolean;
718
- ffmpegFilters: FiltersName[];
719
- disableHistory: boolean;
720
- skipOnNoStream: boolean;
721
- onBeforeCreateStream?: OnBeforeCreateStreamHandler;
722
- onAfterCreateStream?: OnAfterCreateStreamHandler;
723
- repeatMode?: QueueRepeatMode;
724
- leaveOnEmpty: boolean;
725
- leaveOnEmptyCooldown: number;
726
- leaveOnEnd: boolean;
727
- leaveOnEndCooldown: number;
728
- leaveOnStop: boolean;
729
- leaveOnStopCooldown: number;
730
- connectionTimeout: number;
731
- selfDeaf?: boolean;
732
- metadata?: Meta | null;
733
- bufferingTimeout: number;
734
- noEmitInsert: boolean;
735
- maxSize?: number;
736
- maxHistorySize?: number;
737
- preferBridgedMetadata: boolean;
738
- pauseOnEmpty?: boolean;
739
- }
740
- interface VoiceConnectConfig {
741
- deaf?: boolean;
742
- timeout?: number;
743
- group?: string;
744
- audioPlayer?: AudioPlayer;
745
- }
746
- interface PostProcessedResult {
747
- stream: Readable;
748
- type: StreamType;
749
- }
750
- type OnBeforeCreateStreamHandler = (track: Track, queryType: SearchQueryType, queue: GuildQueue) => Promise<Readable | null>;
751
- type OnAfterCreateStreamHandler = (stream: Readable, queue: GuildQueue) => Promise<PostProcessedResult | null>;
752
- type PlayerTriggeredReason = 'filters' | 'normal';
753
- declare const GuildQueueEvent: {
754
- /**
755
- * Emitted when audio track is added to the queue
756
- */
757
- readonly audioTrackAdd: "audioTrackAdd";
758
- /**
759
- * Emitted when audio tracks were added to the queue
760
- */
761
- readonly audioTracksAdd: "audioTracksAdd";
762
- /**
763
- * Emitted when audio track is removed from the queue
764
- */
765
- readonly audioTrackRemove: "audioTrackRemove";
766
- /**
767
- * Emitted when audio tracks are removed from the queue
768
- */
769
- readonly audioTracksRemove: "audioTracksRemove";
770
- /**
771
- * Emitted when a connection is created
772
- */
773
- readonly connection: "connection";
774
- /**
775
- * Emitted when a voice connection is destroyed
776
- */
777
- readonly connectionDestroyed: "connectionDestroyed";
778
- /**
779
- * Emitted when the bot is disconnected from the channel
780
- */
781
- readonly disconnect: "disconnect";
782
- /**
783
- * Emitted when the queue sends a debug info
784
- */
785
- readonly debug: "debug";
786
- /**
787
- * Emitted when the queue encounters error
788
- */
789
- readonly error: "error";
790
- /**
791
- * Emitted when the voice channel is empty
792
- */
793
- readonly emptyChannel: "emptyChannel";
794
- /**
795
- * Emitted when the queue is empty
796
- */
797
- readonly emptyQueue: "emptyQueue";
798
- /**
799
- * Emitted when the audio player starts streaming audio track
800
- */
801
- readonly playerStart: "playerStart";
802
- /**
803
- * Emitted when the audio player errors while streaming audio track
804
- */
805
- readonly playerError: "playerError";
806
- /**
807
- * Emitted when the audio player finishes streaming audio track
808
- */
809
- readonly playerFinish: "playerFinish";
810
- /**
811
- * Emitted when the audio player skips current track
812
- */
813
- readonly playerSkip: "playerSkip";
814
- /**
815
- * Emitted when the audio player is triggered
816
- */
817
- readonly playerTrigger: "playerTrigger";
818
- /**
819
- * Emitted when the voice state is updated. Consuming this event may disable default voice state update handler if `Player.isVoiceStateHandlerLocked()` returns `false`.
820
- */
821
- readonly voiceStateUpdate: "voiceStateUpdate";
822
- /**
823
- * Emitted when volume is updated
824
- */
825
- readonly volumeChange: "volumeChange";
826
- /**
827
- * Emitted when player is paused
828
- */
829
- readonly playerPause: "playerPause";
830
- /**
831
- * Emitted when player is resumed
832
- */
833
- readonly playerResume: "playerResume";
834
- /**
835
- * Biquad Filters Update
836
- */
837
- readonly biquadFiltersUpdate: "biquadFiltersUpdate";
838
- /**
839
- * Equalizer Update
840
- */
841
- readonly equalizerUpdate: "equalizerUpdate";
842
- /**
843
- * DSP update
844
- */
845
- readonly dspUpdate: "dspUpdate";
846
- /**
847
- * Audio Filters Update
848
- */
849
- readonly audioFiltersUpdate: "audioFiltersUpdate";
850
- /**
851
- * Audio player will play next track
852
- */
853
- readonly willPlayTrack: "willPlayTrack";
854
- /**
855
- * Emitted when a voice channel is repopulated
856
- */
857
- readonly channelPopulate: "channelPopulate";
858
- /**
859
- * Emitted when a queue is successfully created
860
- */
861
- readonly queueCreate: "queueCreate";
862
- /**
863
- * Emitted when a queue is deleted
864
- */
865
- readonly queueDelete: "queueDelete";
866
- /**
867
- * Emitted when a queue is trying to add similar track for autoplay
868
- */
869
- readonly willAutoPlay: "willAutoPlay";
870
- };
871
- interface GuildQueueEvents<Meta = any> {
872
- /**
873
- * Emitted when audio track is added to the queue
874
- * @param queue The queue where this event occurred
875
- * @param track The track
876
- */
877
- audioTrackAdd: (queue: GuildQueue<Meta>, track: Track) => unknown;
878
- /**
879
- * Emitted when audio tracks were added to the queue
880
- * @param queue The queue where this event occurred
881
- * @param tracks The tracks array
882
- */
883
- audioTracksAdd: (queue: GuildQueue<Meta>, track: Track[]) => unknown;
884
- /**
885
- * Emitted when audio track is removed from the queue
886
- * @param queue The queue where this event occurred
887
- * @param track The track
888
- */
889
- audioTrackRemove: (queue: GuildQueue<Meta>, track: Track) => unknown;
890
- /**
891
- * Emitted when audio tracks are removed from the queue
892
- * @param queue The queue where this event occurred
893
- * @param track The track
894
- */
895
- audioTracksRemove: (queue: GuildQueue<Meta>, track: Track[]) => unknown;
896
- /**
897
- * Emitted when a connection is created
898
- * @param queue The queue where this event occurred
899
- */
900
- connection: (queue: GuildQueue<Meta>) => unknown;
901
- /**
902
- * Emitted when a connection is destroyed
903
- * @param queue The queue where this event occurred
904
- */
905
- connectionDestroyed: (queue: GuildQueue<Meta>) => unknown;
906
- /**
907
- * Emitted when the bot is disconnected from the channel
908
- * @param queue The queue where this event occurred
909
- */
910
- disconnect: (queue: GuildQueue<Meta>) => unknown;
911
- /**
912
- * Emitted when the queue sends a debug info
913
- * @param queue The queue where this event occurred
914
- * @param message The debug message
915
- */
916
- debug: (queue: GuildQueue<Meta>, message: string) => unknown;
917
- /**
918
- * Emitted when the queue encounters error
919
- * @param queue The queue where this event occurred
920
- * @param error The error
921
- */
922
- error: (queue: GuildQueue<Meta>, error: Error) => unknown;
923
- /**
924
- * Emitted when the voice channel is empty
925
- * @param queue The queue where this event occurred
926
- */
927
- emptyChannel: (queue: GuildQueue<Meta>) => unknown;
928
- /**
929
- * Emitted when the queue is empty
930
- * @param queue The queue where this event occurred
931
- */
932
- emptyQueue: (queue: GuildQueue<Meta>) => unknown;
933
- /**
934
- * Emitted when the audio player starts streaming audio track
935
- * @param queue The queue where this event occurred
936
- * @param track The track that is being streamed
937
- */
938
- playerStart: (queue: GuildQueue<Meta>, track: Track) => unknown;
939
- /**
940
- * Emitted when the audio player errors while streaming audio track
941
- * @param queue The queue where this event occurred
942
- * @param error The error
943
- * @param track The track that is being streamed
944
- */
945
- playerError: (queue: GuildQueue<Meta>, error: Error, track: Track) => unknown;
946
- /**
947
- * Emitted when the audio player finishes streaming audio track
948
- * @param queue The queue where this event occurred
949
- * @param track The track that was being streamed
950
- */
951
- playerFinish: (queue: GuildQueue<Meta>, track: Track) => unknown;
952
- /**
953
- * Emitted when the audio player skips current track
954
- * @param queue The queue where this event occurred
955
- * @param track The track that was skipped
956
- */
957
- playerSkip: (queue: GuildQueue<Meta>, track: Track) => unknown;
958
- /**
959
- * Emitted when the audio player is triggered
960
- * @param queue The queue where this event occurred
961
- * @param track The track which was played in this event
962
- */
963
- playerTrigger: (queue: GuildQueue<Meta>, track: Track, reason: PlayerTriggeredReason) => unknown;
964
- /**
965
- * Emitted when the voice state is updated. Consuming this event may disable default voice state update handler if `Player.isVoiceStateHandlerLocked()` returns `false`.
966
- * @param queue The queue where this event occurred
967
- * @param oldState The old voice state
968
- * @param newState The new voice state
969
- */
970
- voiceStateUpdate: (queue: GuildQueue<Meta>, oldState: VoiceState, newState: VoiceState) => unknown;
971
- /**
972
- * Emitted when audio player is paused
973
- * @param queue The queue where this event occurred
974
- */
975
- playerPause: (queue: GuildQueue<Meta>) => unknown;
976
- /**
977
- * Emitted when audio player is resumed
978
- * @param queue The queue where this event occurred
979
- */
980
- playerResume: (queue: GuildQueue<Meta>) => unknown;
981
- /**
982
- * Emitted when audio player's volume is changed
983
- * @param queue The queue where this event occurred
984
- * @param oldVolume The old volume
985
- * @param newVolume The updated volume
986
- */
987
- volumeChange: (queue: GuildQueue<Meta>, oldVolume: number, newVolume: number) => unknown;
988
- /**
989
- * Emitted when equalizer config is updated
990
- * @param queue The queue where this event occurred
991
- * @param oldFilters Old filters
992
- * @param newFilters New filters
993
- */
994
- equalizerUpdate: (queue: GuildQueue<Meta>, oldFilters: EqualizerBand[], newFilters: EqualizerBand[]) => unknown;
995
- /**
996
- * Emitted when biquad filters is updated
997
- * @param queue The queue where this event occurred
998
- * @param oldFilters Old filters
999
- * @param newFilters New filters
1000
- */
1001
- biquadFiltersUpdate: (queue: GuildQueue<Meta>, oldFilters: BiquadFilters | null, newFilters: BiquadFilters | null) => unknown;
1002
- /**
1003
- * Emitted when dsp filters is updated
1004
- * @param queue The queue where this event occurred
1005
- * @param oldFilters Old filters
1006
- * @param newFilters New filters
1007
- */
1008
- dspUpdate: (queue: GuildQueue<Meta>, oldFilters: PCMFilters[], newFilters: PCMFilters[]) => unknown;
1009
- /**
1010
- * Emitted when ffmpeg audio filters is updated
1011
- * @param queue The queue where this event occurred
1012
- * @param oldFilters Old filters
1013
- * @param newFilters New filters
1014
- */
1015
- audioFiltersUpdate: (queue: GuildQueue<Meta>, oldFilters: FiltersName[], newFilters: FiltersName[]) => unknown;
1016
- /**
1017
- * Emitted before streaming an audio track. This event can be used to modify stream config before playing a track.
1018
- * Listening to this event will pause the execution of audio player until `done()` is invoked.
1019
- * @param queue The queue where this event occurred
1020
- * @param track The track that will be streamed
1021
- * @param config Configurations for streaming
1022
- * @param done Done callback
1023
- */
1024
- willPlayTrack: (queue: GuildQueue<Meta>, track: Track<unknown>, config: StreamConfig, done: () => void) => unknown;
1025
- /**
1026
- * Emitted when a voice channel is populated
1027
- * @param queue The queue where this event occurred
1028
- */
1029
- channelPopulate: (queue: GuildQueue<Meta>) => unknown;
1030
- /**
1031
- * Emitted when a queue is successfully created
1032
- * @param queue The queue where this event occurred
1033
- */
1034
- queueCreate: (queue: GuildQueue<Meta>) => unknown;
1035
- /**
1036
- * Emitted when a queue is successfully deleted
1037
- * @param queue The queue where this event occurred
1038
- */
1039
- queueDelete: (queue: GuildQueue<Meta>) => unknown;
1040
- /**
1041
- * Emitted when a queue is trying to add similar track for autoplay
1042
- * @param queue The queue where this event occurred
1043
- * @param tracks The similar tracks that were found
1044
- * @param done Done callback
1045
- */
1046
- willAutoPlay: (queue: GuildQueue<Meta>, tracks: Track[], done: (track: Track | null) => void) => unknown;
1047
- }
1048
- declare class GuildQueue<Meta = unknown> {
1049
- #private;
1050
- player: Player;
1051
- options: GuildNodeInit<Meta>;
1052
- private __current;
1053
- tracks: Queue<Track>;
1054
- history: GuildQueueHistory<Meta>;
1055
- dispatcher: StreamDispatcher | null;
1056
- node: GuildQueuePlayerNode<Meta>;
1057
- filters: GuildQueueAudioFilters<Meta>;
1058
- onBeforeCreateStream: OnBeforeCreateStreamHandler;
1059
- onAfterCreateStream: OnAfterCreateStreamHandler;
1060
- repeatMode: QueueRepeatMode;
1061
- timeouts: Collection<string, NodeJS.Timeout>;
1062
- stats: GuildQueueStatistics<Meta>;
1063
- tasksQueue: AsyncQueue;
1064
- constructor(player: Player, options: GuildNodeInit<Meta>);
1065
- /**
1066
- * Estimated duration of this queue in ms
1067
- */
1068
- get estimatedDuration(): number;
1069
- /**
1070
- * Formatted duration of this queue
1071
- */
1072
- get durationFormatted(): string;
1073
- /**
1074
- * The voice receiver for this queue
1075
- */
1076
- get voiceReceiver(): VoiceReceiverNode | null;
1077
- /**
1078
- * Write a debug message to this queue
1079
- * @param m The message to write
1080
- */
1081
- debug(m: string): void;
1082
- /**
1083
- * The metadata of this queue
1084
- */
1085
- get metadata(): Meta;
1086
- set metadata(m: Meta);
1087
- /**
1088
- * Set metadata for this queue
1089
- * @param m Metadata to set
1090
- */
1091
- setMetadata(m: Meta): void;
1092
- /**
1093
- * Indicates current track of this queue
1094
- */
1095
- get currentTrack(): Track<unknown> | null;
1096
- /**
1097
- * Indicates if this queue was deleted previously
1098
- */
1099
- get deleted(): boolean;
1100
- /**
1101
- * The voice channel of this queue
1102
- */
1103
- get channel(): VoiceBasedChannel | null;
1104
- set channel(c: VoiceBasedChannel | null);
1105
- /**
1106
- * The voice connection of this queue
1107
- */
1108
- get connection(): VoiceConnection | null;
1109
- /**
1110
- * The guild this queue belongs to
1111
- */
1112
- get guild(): Guild;
1113
- /**
1114
- * The id of this queue
1115
- */
1116
- get id(): string;
1117
- /**
1118
- * Set transition mode for this queue
1119
- * @param state The state to set
1120
- */
1121
- setTransitioning(state: boolean): void;
1122
- /**
1123
- * if this queue is currently under transition mode
1124
- */
1125
- isTransitioning(): boolean;
1126
- /**
1127
- * Set repeat mode for this queue
1128
- * @param mode The repeat mode to apply
1129
- */
1130
- setRepeatMode(mode: QueueRepeatMode): void;
1131
- /**
1132
- * Max size of this queue
1133
- */
1134
- get maxSize(): number;
1135
- /**
1136
- * Max size of this queue
1137
- */
1138
- getMaxSize(): number;
1139
- /**
1140
- * Gets the size of the queue
1141
- */
1142
- get size(): number;
1143
- /**
1144
- * The size of this queue
1145
- */
1146
- getSize(): number;
1147
- /**
1148
- * Max history size of this queue
1149
- */
1150
- get maxHistorySize(): number;
1151
- /**
1152
- * Max history size of this queue
1153
- */
1154
- getMaxHistorySize(): number;
1155
- /**
1156
- * Set max history size for this queue
1157
- * @param size The size to set
1158
- */
1159
- setMaxHistorySize(size: number): void;
1160
- /**
1161
- * Set max size for this queue
1162
- * @param size The size to set
1163
- */
1164
- setMaxSize(size: number): void;
1165
- /**
1166
- * Clear this queue
1167
- */
1168
- clear(): void;
1169
- /**
1170
- * Check if this queue has no tracks left in it
1171
- */
1172
- isEmpty(): boolean;
1173
- /**
1174
- * Check if this queue is full
1175
- */
1176
- isFull(): boolean;
1177
- /**
1178
- * Get queue capacity
1179
- */
1180
- getCapacity(): number;
1181
- /**
1182
- * Check if this queue currently holds active audio resource
1183
- */
1184
- isPlaying(): boolean;
1185
- /**
1186
- * Add track to the queue. This will emit `audioTracksAdd` when multiple tracks are added, otherwise `audioTrackAdd`.
1187
- * @param track Track or playlist or array of tracks to add
1188
- */
1189
- addTrack(track: Track | Track[] | Playlist): void;
1190
- /**
1191
- * Remove a track from queue
1192
- * @param track The track to remove
1193
- */
1194
- removeTrack(track: TrackResolvable): Track<unknown> | null;
1195
- /**
1196
- * Inserts the track to the given index
1197
- * @param track The track to insert
1198
- * @param index The index to insert the track at (defaults to 0)
1199
- */
1200
- insertTrack(track: Track, index?: number): void;
1201
- /**
1202
- * Moves a track in the queue
1203
- * @param from The track to move
1204
- * @param to The position to move to
1205
- */
1206
- moveTrack(track: TrackResolvable, index?: number): void;
1207
- /**
1208
- * Copy a track in the queue
1209
- * @param from The track to clone
1210
- * @param to The position to clone at
1211
- */
1212
- copyTrack(track: TrackResolvable, index?: number): void;
1213
- /**
1214
- * Swap two tracks in the queue
1215
- * @param src The first track to swap
1216
- * @param dest The second track to swap
1217
- */
1218
- swapTracks(src: TrackResolvable, dest: TrackResolvable): void;
1219
- /**
1220
- * Create stream dispatcher from the given connection
1221
- * @param connection The connection to use
1222
- */
1223
- createDispatcher(connection: VoiceConnection, options?: Pick<VoiceConnectConfig, 'audioPlayer' | 'timeout'>): void;
1224
- /**
1225
- * Connect to a voice channel
1226
- * @param channelResolvable The voice channel to connect to
1227
- * @param options Join config
1228
- */
1229
- connect(channelResolvable: GuildVoiceChannelResolvable, options?: VoiceConnectConfig): Promise<this>;
1230
- /**
1231
- * The voice connection latency of this queue
1232
- */
1233
- get ping(): number;
1234
- /**
1235
- * Delete this queue
1236
- */
1237
- delete(): void;
1238
- /**
1239
- * Revives this queue
1240
- * @returns
1241
- */
1242
- revive(): void;
1243
- /**
1244
- * Set self deaf
1245
- * @param mode On/Off state
1246
- * @param reason Reason
1247
- */
1248
- setSelfDeaf(mode?: boolean, reason?: string): Promise<discord_js.GuildMember>;
1249
- /**
1250
- * Set self mute
1251
- * @param mode On/Off state
1252
- * @param reason Reason
1253
- */
1254
- setSelfMute(mode?: boolean, reason?: string): Promise<discord_js.GuildMember>;
1255
- /**
1256
- * Play a track in this queue
1257
- * @param track The track to be played
1258
- * @param options Player node initialization options
1259
- */
1260
- play(track: TrackLike, options?: PlayerNodeInitializerOptions<Meta>): Promise<PlayerNodeInitializationResult<Meta>>;
1261
- /**
1262
- * Emit an event on this queue
1263
- * @param event The event to emit
1264
- * @param args The args for the event
1265
- */
1266
- emit<K extends keyof GuildQueueEvents<Meta>>(event: K, ...args: Parameters<GuildQueueEvents<Meta>[K]>): boolean;
1267
- get hasDebugger(): boolean;
710
+ interface GuildNodeInit<Meta = unknown> {
711
+ guild: Guild;
712
+ queueStrategy: QueueStrategy;
713
+ equalizer: EqualizerBand[] | boolean;
714
+ volume: number | boolean;
715
+ biquad: BiquadFilters | boolean | undefined;
716
+ resampler: number | boolean;
717
+ filterer: PCMFilters[] | boolean;
718
+ ffmpegFilters: FiltersName[];
719
+ disableHistory: boolean;
720
+ skipOnNoStream: boolean;
721
+ onBeforeCreateStream?: OnBeforeCreateStreamHandler;
722
+ onAfterCreateStream?: OnAfterCreateStreamHandler;
723
+ repeatMode?: QueueRepeatMode;
724
+ leaveOnEmpty: boolean;
725
+ leaveOnEmptyCooldown: number;
726
+ leaveOnEnd: boolean;
727
+ leaveOnEndCooldown: number;
728
+ leaveOnStop: boolean;
729
+ leaveOnStopCooldown: number;
730
+ connectionTimeout: number;
731
+ selfDeaf?: boolean;
732
+ metadata?: Meta | null;
733
+ bufferingTimeout: number;
734
+ noEmitInsert: boolean;
735
+ maxSize?: number;
736
+ maxHistorySize?: number;
737
+ preferBridgedMetadata: boolean;
738
+ pauseOnEmpty?: boolean;
739
+ disableVolume: boolean;
740
+ disableEqualizer: boolean;
741
+ disableFilterer: boolean;
742
+ disableBiquad: boolean;
743
+ disableResampler: boolean;
744
+ }
745
+ interface VoiceConnectConfig {
746
+ deaf?: boolean;
747
+ timeout?: number;
748
+ group?: string;
749
+ audioPlayer?: AudioPlayer;
750
+ }
751
+ interface PostProcessedResult {
752
+ stream: Readable;
753
+ type: StreamType;
754
+ }
755
+ type OnBeforeCreateStreamHandler = (track: Track, queryType: SearchQueryType, queue: GuildQueue) => Promise<Readable | null>;
756
+ type OnAfterCreateStreamHandler = (stream: Readable, queue: GuildQueue) => Promise<PostProcessedResult | null>;
757
+ type PlayerTriggeredReason = 'filters' | 'normal';
758
+ declare const GuildQueueEvent: {
759
+ /**
760
+ * Emitted when audio track is added to the queue
761
+ */
762
+ readonly audioTrackAdd: "audioTrackAdd";
763
+ /**
764
+ * Emitted when audio tracks were added to the queue
765
+ */
766
+ readonly audioTracksAdd: "audioTracksAdd";
767
+ /**
768
+ * Emitted when audio track is removed from the queue
769
+ */
770
+ readonly audioTrackRemove: "audioTrackRemove";
771
+ /**
772
+ * Emitted when audio tracks are removed from the queue
773
+ */
774
+ readonly audioTracksRemove: "audioTracksRemove";
775
+ /**
776
+ * Emitted when a connection is created
777
+ */
778
+ readonly connection: "connection";
779
+ /**
780
+ * Emitted when a voice connection is destroyed
781
+ */
782
+ readonly connectionDestroyed: "connectionDestroyed";
783
+ /**
784
+ * Emitted when the bot is disconnected from the channel
785
+ */
786
+ readonly disconnect: "disconnect";
787
+ /**
788
+ * Emitted when the queue sends a debug info
789
+ */
790
+ readonly debug: "debug";
791
+ /**
792
+ * Emitted when the queue encounters error
793
+ */
794
+ readonly error: "error";
795
+ /**
796
+ * Emitted when the voice channel is empty
797
+ */
798
+ readonly emptyChannel: "emptyChannel";
799
+ /**
800
+ * Emitted when the queue is empty
801
+ */
802
+ readonly emptyQueue: "emptyQueue";
803
+ /**
804
+ * Emitted when the audio player starts streaming audio track
805
+ */
806
+ readonly playerStart: "playerStart";
807
+ /**
808
+ * Emitted when the audio player errors while streaming audio track
809
+ */
810
+ readonly playerError: "playerError";
811
+ /**
812
+ * Emitted when the audio player finishes streaming audio track
813
+ */
814
+ readonly playerFinish: "playerFinish";
815
+ /**
816
+ * Emitted when the audio player skips current track
817
+ */
818
+ readonly playerSkip: "playerSkip";
819
+ /**
820
+ * Emitted when the audio player is triggered
821
+ */
822
+ readonly playerTrigger: "playerTrigger";
823
+ /**
824
+ * Emitted when the voice state is updated. Consuming this event may disable default voice state update handler if `Player.isVoiceStateHandlerLocked()` returns `false`.
825
+ */
826
+ readonly voiceStateUpdate: "voiceStateUpdate";
827
+ /**
828
+ * Emitted when volume is updated
829
+ */
830
+ readonly volumeChange: "volumeChange";
831
+ /**
832
+ * Emitted when player is paused
833
+ */
834
+ readonly playerPause: "playerPause";
835
+ /**
836
+ * Emitted when player is resumed
837
+ */
838
+ readonly playerResume: "playerResume";
839
+ /**
840
+ * Biquad Filters Update
841
+ */
842
+ readonly biquadFiltersUpdate: "biquadFiltersUpdate";
843
+ /**
844
+ * Equalizer Update
845
+ */
846
+ readonly equalizerUpdate: "equalizerUpdate";
847
+ /**
848
+ * DSP update
849
+ */
850
+ readonly dspUpdate: "dspUpdate";
851
+ /**
852
+ * Audio Filters Update
853
+ */
854
+ readonly audioFiltersUpdate: "audioFiltersUpdate";
855
+ /**
856
+ * Audio player will play next track
857
+ */
858
+ readonly willPlayTrack: "willPlayTrack";
859
+ /**
860
+ * Emitted when a voice channel is repopulated
861
+ */
862
+ readonly channelPopulate: "channelPopulate";
863
+ /**
864
+ * Emitted when a queue is successfully created
865
+ */
866
+ readonly queueCreate: "queueCreate";
867
+ /**
868
+ * Emitted when a queue is deleted
869
+ */
870
+ readonly queueDelete: "queueDelete";
871
+ /**
872
+ * Emitted when a queue is trying to add similar track for autoplay
873
+ */
874
+ readonly willAutoPlay: "willAutoPlay";
875
+ };
876
+ interface GuildQueueEvents<Meta = any> {
877
+ /**
878
+ * Emitted when audio track is added to the queue
879
+ * @param queue The queue where this event occurred
880
+ * @param track The track
881
+ */
882
+ audioTrackAdd: (queue: GuildQueue<Meta>, track: Track) => unknown;
883
+ /**
884
+ * Emitted when audio tracks were added to the queue
885
+ * @param queue The queue where this event occurred
886
+ * @param tracks The tracks array
887
+ */
888
+ audioTracksAdd: (queue: GuildQueue<Meta>, track: Track[]) => unknown;
889
+ /**
890
+ * Emitted when audio track is removed from the queue
891
+ * @param queue The queue where this event occurred
892
+ * @param track The track
893
+ */
894
+ audioTrackRemove: (queue: GuildQueue<Meta>, track: Track) => unknown;
895
+ /**
896
+ * Emitted when audio tracks are removed from the queue
897
+ * @param queue The queue where this event occurred
898
+ * @param track The track
899
+ */
900
+ audioTracksRemove: (queue: GuildQueue<Meta>, track: Track[]) => unknown;
901
+ /**
902
+ * Emitted when a connection is created
903
+ * @param queue The queue where this event occurred
904
+ */
905
+ connection: (queue: GuildQueue<Meta>) => unknown;
906
+ /**
907
+ * Emitted when a connection is destroyed
908
+ * @param queue The queue where this event occurred
909
+ */
910
+ connectionDestroyed: (queue: GuildQueue<Meta>) => unknown;
911
+ /**
912
+ * Emitted when the bot is disconnected from the channel
913
+ * @param queue The queue where this event occurred
914
+ */
915
+ disconnect: (queue: GuildQueue<Meta>) => unknown;
916
+ /**
917
+ * Emitted when the queue sends a debug info
918
+ * @param queue The queue where this event occurred
919
+ * @param message The debug message
920
+ */
921
+ debug: (queue: GuildQueue<Meta>, message: string) => unknown;
922
+ /**
923
+ * Emitted when the queue encounters error
924
+ * @param queue The queue where this event occurred
925
+ * @param error The error
926
+ */
927
+ error: (queue: GuildQueue<Meta>, error: Error) => unknown;
928
+ /**
929
+ * Emitted when the voice channel is empty
930
+ * @param queue The queue where this event occurred
931
+ */
932
+ emptyChannel: (queue: GuildQueue<Meta>) => unknown;
933
+ /**
934
+ * Emitted when the queue is empty
935
+ * @param queue The queue where this event occurred
936
+ */
937
+ emptyQueue: (queue: GuildQueue<Meta>) => unknown;
938
+ /**
939
+ * Emitted when the audio player starts streaming audio track
940
+ * @param queue The queue where this event occurred
941
+ * @param track The track that is being streamed
942
+ */
943
+ playerStart: (queue: GuildQueue<Meta>, track: Track) => unknown;
944
+ /**
945
+ * Emitted when the audio player errors while streaming audio track
946
+ * @param queue The queue where this event occurred
947
+ * @param error The error
948
+ * @param track The track that is being streamed
949
+ */
950
+ playerError: (queue: GuildQueue<Meta>, error: Error, track: Track) => unknown;
951
+ /**
952
+ * Emitted when the audio player finishes streaming audio track
953
+ * @param queue The queue where this event occurred
954
+ * @param track The track that was being streamed
955
+ */
956
+ playerFinish: (queue: GuildQueue<Meta>, track: Track) => unknown;
957
+ /**
958
+ * Emitted when the audio player skips current track
959
+ * @param queue The queue where this event occurred
960
+ * @param track The track that was skipped
961
+ */
962
+ playerSkip: (queue: GuildQueue<Meta>, track: Track) => unknown;
963
+ /**
964
+ * Emitted when the audio player is triggered
965
+ * @param queue The queue where this event occurred
966
+ * @param track The track which was played in this event
967
+ */
968
+ playerTrigger: (queue: GuildQueue<Meta>, track: Track, reason: PlayerTriggeredReason) => unknown;
969
+ /**
970
+ * Emitted when the voice state is updated. Consuming this event may disable default voice state update handler if `Player.isVoiceStateHandlerLocked()` returns `false`.
971
+ * @param queue The queue where this event occurred
972
+ * @param oldState The old voice state
973
+ * @param newState The new voice state
974
+ */
975
+ voiceStateUpdate: (queue: GuildQueue<Meta>, oldState: VoiceState, newState: VoiceState) => unknown;
976
+ /**
977
+ * Emitted when audio player is paused
978
+ * @param queue The queue where this event occurred
979
+ */
980
+ playerPause: (queue: GuildQueue<Meta>) => unknown;
981
+ /**
982
+ * Emitted when audio player is resumed
983
+ * @param queue The queue where this event occurred
984
+ */
985
+ playerResume: (queue: GuildQueue<Meta>) => unknown;
986
+ /**
987
+ * Emitted when audio player's volume is changed
988
+ * @param queue The queue where this event occurred
989
+ * @param oldVolume The old volume
990
+ * @param newVolume The updated volume
991
+ */
992
+ volumeChange: (queue: GuildQueue<Meta>, oldVolume: number, newVolume: number) => unknown;
993
+ /**
994
+ * Emitted when equalizer config is updated
995
+ * @param queue The queue where this event occurred
996
+ * @param oldFilters Old filters
997
+ * @param newFilters New filters
998
+ */
999
+ equalizerUpdate: (queue: GuildQueue<Meta>, oldFilters: EqualizerBand[], newFilters: EqualizerBand[]) => unknown;
1000
+ /**
1001
+ * Emitted when biquad filters is updated
1002
+ * @param queue The queue where this event occurred
1003
+ * @param oldFilters Old filters
1004
+ * @param newFilters New filters
1005
+ */
1006
+ biquadFiltersUpdate: (queue: GuildQueue<Meta>, oldFilters: BiquadFilters | null, newFilters: BiquadFilters | null) => unknown;
1007
+ /**
1008
+ * Emitted when dsp filters is updated
1009
+ * @param queue The queue where this event occurred
1010
+ * @param oldFilters Old filters
1011
+ * @param newFilters New filters
1012
+ */
1013
+ dspUpdate: (queue: GuildQueue<Meta>, oldFilters: PCMFilters[], newFilters: PCMFilters[]) => unknown;
1014
+ /**
1015
+ * Emitted when ffmpeg audio filters is updated
1016
+ * @param queue The queue where this event occurred
1017
+ * @param oldFilters Old filters
1018
+ * @param newFilters New filters
1019
+ */
1020
+ audioFiltersUpdate: (queue: GuildQueue<Meta>, oldFilters: FiltersName[], newFilters: FiltersName[]) => unknown;
1021
+ /**
1022
+ * Emitted before streaming an audio track. This event can be used to modify stream config before playing a track.
1023
+ * Listening to this event will pause the execution of audio player until `done()` is invoked.
1024
+ * @param queue The queue where this event occurred
1025
+ * @param track The track that will be streamed
1026
+ * @param config Configurations for streaming
1027
+ * @param done Done callback
1028
+ */
1029
+ willPlayTrack: (queue: GuildQueue<Meta>, track: Track<unknown>, config: StreamConfig, done: () => void) => unknown;
1030
+ /**
1031
+ * Emitted when a voice channel is populated
1032
+ * @param queue The queue where this event occurred
1033
+ */
1034
+ channelPopulate: (queue: GuildQueue<Meta>) => unknown;
1035
+ /**
1036
+ * Emitted when a queue is successfully created
1037
+ * @param queue The queue where this event occurred
1038
+ */
1039
+ queueCreate: (queue: GuildQueue<Meta>) => unknown;
1040
+ /**
1041
+ * Emitted when a queue is successfully deleted
1042
+ * @param queue The queue where this event occurred
1043
+ */
1044
+ queueDelete: (queue: GuildQueue<Meta>) => unknown;
1045
+ /**
1046
+ * Emitted when a queue is trying to add similar track for autoplay
1047
+ * @param queue The queue where this event occurred
1048
+ * @param tracks The similar tracks that were found
1049
+ * @param done Done callback
1050
+ */
1051
+ willAutoPlay: (queue: GuildQueue<Meta>, tracks: Track[], done: (track: Track | null) => void) => unknown;
1052
+ }
1053
+ declare class GuildQueue<Meta = unknown> {
1054
+ #private;
1055
+ player: Player;
1056
+ options: GuildNodeInit<Meta>;
1057
+ private __current;
1058
+ tracks: Queue<Track>;
1059
+ history: GuildQueueHistory<Meta>;
1060
+ dispatcher: StreamDispatcher | null;
1061
+ node: GuildQueuePlayerNode<Meta>;
1062
+ filters: GuildQueueAudioFilters<Meta>;
1063
+ onBeforeCreateStream: OnBeforeCreateStreamHandler;
1064
+ onAfterCreateStream: OnAfterCreateStreamHandler;
1065
+ repeatMode: QueueRepeatMode;
1066
+ timeouts: Collection<string, NodeJS.Timeout>;
1067
+ stats: GuildQueueStatistics<Meta>;
1068
+ tasksQueue: AsyncQueue;
1069
+ constructor(player: Player, options: GuildNodeInit<Meta>);
1070
+ /**
1071
+ * Estimated duration of this queue in ms
1072
+ */
1073
+ get estimatedDuration(): number;
1074
+ /**
1075
+ * Formatted duration of this queue
1076
+ */
1077
+ get durationFormatted(): string;
1078
+ /**
1079
+ * The voice receiver for this queue
1080
+ */
1081
+ get voiceReceiver(): VoiceReceiverNode | null;
1082
+ /**
1083
+ * Write a debug message to this queue
1084
+ * @param m The message to write
1085
+ */
1086
+ debug(m: string): void;
1087
+ /**
1088
+ * The metadata of this queue
1089
+ */
1090
+ get metadata(): Meta;
1091
+ set metadata(m: Meta);
1092
+ /**
1093
+ * Set metadata for this queue
1094
+ * @param m Metadata to set
1095
+ */
1096
+ setMetadata(m: Meta): void;
1097
+ /**
1098
+ * Indicates current track of this queue
1099
+ */
1100
+ get currentTrack(): Track<unknown> | null;
1101
+ /**
1102
+ * Indicates if this queue was deleted previously
1103
+ */
1104
+ get deleted(): boolean;
1105
+ /**
1106
+ * The voice channel of this queue
1107
+ */
1108
+ get channel(): VoiceBasedChannel | null;
1109
+ set channel(c: VoiceBasedChannel | null);
1110
+ /**
1111
+ * The voice connection of this queue
1112
+ */
1113
+ get connection(): VoiceConnection | null;
1114
+ /**
1115
+ * The guild this queue belongs to
1116
+ */
1117
+ get guild(): Guild;
1118
+ /**
1119
+ * The id of this queue
1120
+ */
1121
+ get id(): string;
1122
+ /**
1123
+ * Set transition mode for this queue
1124
+ * @param state The state to set
1125
+ */
1126
+ setTransitioning(state: boolean): void;
1127
+ /**
1128
+ * if this queue is currently under transition mode
1129
+ */
1130
+ isTransitioning(): boolean;
1131
+ /**
1132
+ * Set repeat mode for this queue
1133
+ * @param mode The repeat mode to apply
1134
+ */
1135
+ setRepeatMode(mode: QueueRepeatMode): void;
1136
+ /**
1137
+ * Max size of this queue
1138
+ */
1139
+ get maxSize(): number;
1140
+ /**
1141
+ * Max size of this queue
1142
+ */
1143
+ getMaxSize(): number;
1144
+ /**
1145
+ * Gets the size of the queue
1146
+ */
1147
+ get size(): number;
1148
+ /**
1149
+ * The size of this queue
1150
+ */
1151
+ getSize(): number;
1152
+ /**
1153
+ * Max history size of this queue
1154
+ */
1155
+ get maxHistorySize(): number;
1156
+ /**
1157
+ * Max history size of this queue
1158
+ */
1159
+ getMaxHistorySize(): number;
1160
+ /**
1161
+ * Set max history size for this queue
1162
+ * @param size The size to set
1163
+ */
1164
+ setMaxHistorySize(size: number): void;
1165
+ /**
1166
+ * Set max size for this queue
1167
+ * @param size The size to set
1168
+ */
1169
+ setMaxSize(size: number): void;
1170
+ /**
1171
+ * Clear this queue
1172
+ */
1173
+ clear(): void;
1174
+ /**
1175
+ * Check if this queue has no tracks left in it
1176
+ */
1177
+ isEmpty(): boolean;
1178
+ /**
1179
+ * Check if this queue is full
1180
+ */
1181
+ isFull(): boolean;
1182
+ /**
1183
+ * Get queue capacity
1184
+ */
1185
+ getCapacity(): number;
1186
+ /**
1187
+ * Check if this queue currently holds active audio resource
1188
+ */
1189
+ isPlaying(): boolean;
1190
+ /**
1191
+ * Add track to the queue. This will emit `audioTracksAdd` when multiple tracks are added, otherwise `audioTrackAdd`.
1192
+ * @param track Track or playlist or array of tracks to add
1193
+ */
1194
+ addTrack(track: Track | Track[] | Playlist): void;
1195
+ /**
1196
+ * Remove a track from queue
1197
+ * @param track The track to remove
1198
+ */
1199
+ removeTrack(track: TrackResolvable): Track<unknown> | null;
1200
+ /**
1201
+ * Inserts the track to the given index
1202
+ * @param track The track to insert
1203
+ * @param index The index to insert the track at (defaults to 0)
1204
+ */
1205
+ insertTrack(track: Track, index?: number): void;
1206
+ /**
1207
+ * Moves a track in the queue
1208
+ * @param from The track to move
1209
+ * @param to The position to move to
1210
+ */
1211
+ moveTrack(track: TrackResolvable, index?: number): void;
1212
+ /**
1213
+ * Copy a track in the queue
1214
+ * @param from The track to clone
1215
+ * @param to The position to clone at
1216
+ */
1217
+ copyTrack(track: TrackResolvable, index?: number): void;
1218
+ /**
1219
+ * Swap two tracks in the queue
1220
+ * @param src The first track to swap
1221
+ * @param dest The second track to swap
1222
+ */
1223
+ swapTracks(src: TrackResolvable, dest: TrackResolvable): void;
1224
+ /**
1225
+ * Create stream dispatcher from the given connection
1226
+ * @param connection The connection to use
1227
+ */
1228
+ createDispatcher(connection: VoiceConnection, options?: Pick<VoiceConnectConfig, 'audioPlayer' | 'timeout'>): void;
1229
+ /**
1230
+ * Connect to a voice channel
1231
+ * @param channelResolvable The voice channel to connect to
1232
+ * @param options Join config
1233
+ */
1234
+ connect(channelResolvable: GuildVoiceChannelResolvable, options?: VoiceConnectConfig): Promise<this>;
1235
+ /**
1236
+ * The voice connection latency of this queue
1237
+ */
1238
+ get ping(): number;
1239
+ /**
1240
+ * Delete this queue
1241
+ */
1242
+ delete(): void;
1243
+ /**
1244
+ * Revives this queue
1245
+ * @returns
1246
+ */
1247
+ revive(): void;
1248
+ /**
1249
+ * Set self deaf
1250
+ * @param mode On/Off state
1251
+ * @param reason Reason
1252
+ */
1253
+ setSelfDeaf(mode?: boolean, reason?: string): Promise<discord_js.GuildMember>;
1254
+ /**
1255
+ * Set self mute
1256
+ * @param mode On/Off state
1257
+ * @param reason Reason
1258
+ */
1259
+ setSelfMute(mode?: boolean, reason?: string): Promise<discord_js.GuildMember>;
1260
+ /**
1261
+ * Play a track in this queue
1262
+ * @param track The track to be played
1263
+ * @param options Player node initialization options
1264
+ */
1265
+ play(track: TrackLike, options?: PlayerNodeInitializerOptions<Meta>): Promise<PlayerNodeInitializationResult<Meta>>;
1266
+ /**
1267
+ * Emit an event on this queue
1268
+ * @param event The event to emit
1269
+ * @param args The args for the event
1270
+ */
1271
+ emit<K extends keyof GuildQueueEvents<Meta>>(event: K, ...args: Parameters<GuildQueueEvents<Meta>[K]>): boolean;
1272
+ get hasDebugger(): boolean;
1268
1273
  }
1269
1274
 
1270
- type TrackResolvable = Track | string | number;
1271
- type WithMetadata<T extends object, M> = T & {
1272
- metadata: M;
1273
- requestMetadata(): Promise<M>;
1274
- };
1275
- declare class Track<T = unknown> {
1276
- readonly player: Player;
1277
- title: string;
1278
- description: string;
1279
- author: string;
1280
- url: string;
1281
- thumbnail: string;
1282
- duration: string;
1283
- views: number;
1284
- requestedBy: User | null;
1285
- playlist?: Playlist;
1286
- queryType: SearchQueryType | null | undefined;
1287
- raw: RawTrackData;
1288
- extractor: BaseExtractor | null;
1289
- readonly id: string;
1290
- private __metadata;
1291
- private __reqMetadataFn;
1292
- /**
1293
- * Track constructor
1294
- * @param player The player that instantiated this Track
1295
- * @param data Track data
1296
- */
1297
- constructor(player: Player, data: Partial<WithMetadata<RawTrackData, T>>);
1298
- /**
1299
- * Request metadata for this track
1300
- */
1301
- requestMetadata(): Promise<T | null>;
1302
- /**
1303
- * Set metadata for this track
1304
- */
1305
- setMetadata(m: T | null): void;
1306
- /**
1307
- * Metadata of this track
1308
- */
1309
- get metadata(): T | null;
1310
- /**
1311
- * If this track has metadata
1312
- */
1313
- get hasMetadata(): boolean;
1314
- /**
1315
- * The queue in which this track is located
1316
- */
1317
- get queue(): GuildQueue;
1318
- /**
1319
- * The track duration in millisecond
1320
- */
1321
- get durationMS(): number;
1322
- /**
1323
- * Discord hyperlink representation of this track
1324
- */
1325
- toHyperlink(): string;
1326
- /**
1327
- * Returns source of this track
1328
- */
1329
- get source(): TrackSource;
1330
- /**
1331
- * String representation of this track
1332
- */
1333
- toString(): string;
1334
- /**
1335
- * Raw JSON representation of this track
1336
- */
1337
- toJSON(hidePlaylist?: boolean): TrackJSON;
1338
- /**
1339
- * Get belonging queues of this track
1340
- */
1341
- getBelongingQueues(): Collection<string, GuildQueue<unknown>>;
1342
- /**
1343
- * Play this track to the given voice channel. If queue exists and another track is being played, this track will be added to the queue.
1344
- * @param channel Voice channel on which this track shall be played
1345
- * @param options Node initialization options
1346
- */
1347
- play<T = unknown>(channel: GuildVoiceChannelResolvable, options?: PlayerNodeInitializerOptions<T>): Promise<PlayerNodeInitializationResult<T>>;
1275
+ type TrackResolvable = Track | string | number;
1276
+ type WithMetadata<T extends object, M> = T & {
1277
+ metadata: M;
1278
+ requestMetadata(): Promise<M>;
1279
+ };
1280
+ declare class Track<T = unknown> {
1281
+ readonly player: Player;
1282
+ title: string;
1283
+ description: string;
1284
+ author: string;
1285
+ url: string;
1286
+ thumbnail: string;
1287
+ duration: string;
1288
+ views: number;
1289
+ requestedBy: User | null;
1290
+ playlist?: Playlist;
1291
+ queryType: SearchQueryType | null | undefined;
1292
+ raw: RawTrackData;
1293
+ extractor: BaseExtractor | null;
1294
+ readonly id: string;
1295
+ private __metadata;
1296
+ private __reqMetadataFn;
1297
+ /**
1298
+ * Track constructor
1299
+ * @param player The player that instantiated this Track
1300
+ * @param data Track data
1301
+ */
1302
+ constructor(player: Player, data: Partial<WithMetadata<RawTrackData, T>>);
1303
+ /**
1304
+ * Request metadata for this track
1305
+ */
1306
+ requestMetadata(): Promise<T | null>;
1307
+ /**
1308
+ * Set metadata for this track
1309
+ */
1310
+ setMetadata(m: T | null): void;
1311
+ /**
1312
+ * Metadata of this track
1313
+ */
1314
+ get metadata(): T | null;
1315
+ /**
1316
+ * If this track has metadata
1317
+ */
1318
+ get hasMetadata(): boolean;
1319
+ /**
1320
+ * The queue in which this track is located
1321
+ */
1322
+ get queue(): GuildQueue;
1323
+ /**
1324
+ * The track duration in millisecond
1325
+ */
1326
+ get durationMS(): number;
1327
+ /**
1328
+ * Discord hyperlink representation of this track
1329
+ */
1330
+ toHyperlink(): string;
1331
+ /**
1332
+ * Returns source of this track
1333
+ */
1334
+ get source(): TrackSource;
1335
+ /**
1336
+ * String representation of this track
1337
+ */
1338
+ toString(): string;
1339
+ /**
1340
+ * Raw JSON representation of this track
1341
+ */
1342
+ toJSON(hidePlaylist?: boolean): TrackJSON;
1343
+ /**
1344
+ * Get belonging queues of this track
1345
+ */
1346
+ getBelongingQueues(): Collection<string, GuildQueue<unknown>>;
1347
+ /**
1348
+ * Play this track to the given voice channel. If queue exists and another track is being played, this track will be added to the queue.
1349
+ * @param channel Voice channel on which this track shall be played
1350
+ * @param options Node initialization options
1351
+ */
1352
+ play<T = unknown>(channel: GuildVoiceChannelResolvable, options?: PlayerNodeInitializerOptions<T>): Promise<PlayerNodeInitializationResult<T>>;
1348
1353
  }
1349
1354
 
1350
- declare class Playlist {
1351
- readonly player: Player;
1352
- tracks: Track[];
1353
- title: string;
1354
- description: string;
1355
- thumbnail: string;
1356
- type: 'album' | 'playlist';
1357
- source: TrackSource;
1358
- author: {
1359
- name: string;
1360
- url: string;
1361
- };
1362
- id: string;
1363
- url: string;
1364
- readonly rawPlaylist?: any;
1365
- /**
1366
- * Playlist constructor
1367
- * @param {Player} player The player
1368
- * @param {PlaylistInitData} data The data
1369
- */
1370
- constructor(player: Player, data: PlaylistInitData);
1371
- [Symbol.iterator](): Generator<Track<unknown>, void, undefined>;
1372
- /**
1373
- * Estimated duration of this playlist
1374
- */
1375
- get estimatedDuration(): number;
1376
- /**
1377
- * Formatted estimated duration of this playlist
1378
- */
1379
- get durationFormatted(): string;
1380
- /**
1381
- * JSON representation of this playlist
1382
- * @param {boolean} [withTracks=true] If it should build json with tracks
1383
- * @returns {PlaylistJSON}
1384
- */
1385
- toJSON(withTracks?: boolean): PlaylistJSON;
1386
- /**
1387
- * Play this playlist to the given voice channel. If queue exists and another track is being played, this playlist will be added to the queue.
1388
- * @param channel Voice channel on which this playlist shall be played
1389
- * @param options Node initialization options
1390
- */
1391
- play<T = unknown>(channel: GuildVoiceChannelResolvable, options?: PlayerNodeInitializerOptions<T>): Promise<PlayerNodeInitializationResult<T>>;
1355
+ declare class Playlist {
1356
+ readonly player: Player;
1357
+ tracks: Track[];
1358
+ title: string;
1359
+ description: string;
1360
+ thumbnail: string;
1361
+ type: 'album' | 'playlist';
1362
+ source: TrackSource;
1363
+ author: {
1364
+ name: string;
1365
+ url: string;
1366
+ };
1367
+ id: string;
1368
+ url: string;
1369
+ readonly rawPlaylist?: any;
1370
+ /**
1371
+ * Playlist constructor
1372
+ * @param {Player} player The player
1373
+ * @param {PlaylistInitData} data The data
1374
+ */
1375
+ constructor(player: Player, data: PlaylistInitData);
1376
+ [Symbol.iterator](): Generator<Track<unknown>, void, undefined>;
1377
+ /**
1378
+ * Estimated duration of this playlist
1379
+ */
1380
+ get estimatedDuration(): number;
1381
+ /**
1382
+ * Formatted estimated duration of this playlist
1383
+ */
1384
+ get durationFormatted(): string;
1385
+ /**
1386
+ * JSON representation of this playlist
1387
+ * @param {boolean} [withTracks=true] If it should build json with tracks
1388
+ * @returns {PlaylistJSON}
1389
+ */
1390
+ toJSON(withTracks?: boolean): PlaylistJSON;
1391
+ /**
1392
+ * Play this playlist to the given voice channel. If queue exists and another track is being played, this playlist will be added to the queue.
1393
+ * @param channel Voice channel on which this playlist shall be played
1394
+ * @param options Node initialization options
1395
+ */
1396
+ play<T = unknown>(channel: GuildVoiceChannelResolvable, options?: PlayerNodeInitializerOptions<T>): Promise<PlayerNodeInitializationResult<T>>;
1392
1397
  }
1393
1398
 
1394
- declare const knownExtractorKeys: readonly ["SpotifyExtractor", "AppleMusicExtractor", "SoundCloudExtractor", "YouTubeExtractor", "VimeoExtractor", "ReverbnationExtractor", "AttachmentExtractor"];
1395
- interface ExtractorExecutionEvents {
1396
- /**
1397
- * Emitted when a extractor is registered
1398
- * @param context The context where extractor was registered
1399
- * @param extractor The extractor that was registered
1400
- */
1401
- registered: (context: ExtractorExecutionContext, extractor: BaseExtractor) => unknown;
1402
- /**
1403
- * Emitted when a extractor is unregistered
1404
- * @param context The context where extractor was unregistered
1405
- * @param extractor The extractor that was unregistered
1406
- */
1407
- unregistered: (context: ExtractorExecutionContext, extractor: BaseExtractor) => unknown;
1408
- /**
1409
- * Emitted when a extractor is activated
1410
- * @param context The context where this event occurred
1411
- * @param extractor The extractor which was activated
1412
- */
1413
- activate: (context: ExtractorExecutionContext, extractor: BaseExtractor) => unknown;
1414
- /**
1415
- * Emitted when a extractor is deactivated
1416
- * @param context The context where this event occurred
1417
- * @param extractor The extractor which was deactivated
1418
- */
1419
- deactivate: (context: ExtractorExecutionContext, extractor: BaseExtractor) => unknown;
1420
- /**
1421
- * Emitted when a extractor fails to activate/deactivate
1422
- * @param context The context where this event occurred
1423
- * @param extractor The extractor which was deactivated
1424
- */
1425
- error: (context: ExtractorExecutionContext, extractor: BaseExtractor, error: Error) => unknown;
1426
- }
1427
- declare class ExtractorExecutionContext extends PlayerEventsEmitter<ExtractorExecutionEvents> {
1428
- player: Player;
1429
- store: Collection<string, BaseExtractor<object>>;
1430
- constructor(player: Player);
1431
- /**
1432
- * Load default extractors from `@discord-player/extractor`
1433
- */
1434
- loadDefault(filter?: (ext: (typeof knownExtractorKeys)[number]) => boolean): Promise<{
1435
- success: boolean;
1436
- error: Error;
1437
- } | {
1438
- success: boolean;
1439
- error: null;
1440
- }>;
1441
- /**
1442
- * Validate if the given extractor is registered
1443
- * @param identifier The extractor identifier
1444
- */
1445
- isRegistered(identifier: string): boolean;
1446
- /**
1447
- * The size of registered extractors
1448
- */
1449
- get size(): number;
1450
- /**
1451
- * Get single extractor
1452
- * @param identifier The extractor to get
1453
- */
1454
- get(identifier: string): BaseExtractor<object> | undefined;
1455
- /**
1456
- * Register single extractor
1457
- * @param _extractor The extractor to register
1458
- * @param options Options supplied to the extractor
1459
- */
1460
- register<O extends object, T extends typeof BaseExtractor<O>>(_extractor: T, options: ConstructorParameters<T>['1']): Promise<InstanceType<T> | null>;
1461
- /**
1462
- * Unregister single extractor
1463
- * @param _extractor The extractor to unregister
1464
- */
1465
- unregister<K extends string | BaseExtractor>(_extractor: K): Promise<void>;
1466
- /**
1467
- * Unregister all extractors
1468
- */
1469
- unregisterAll(): Promise<void>;
1470
- /**
1471
- * Run all the extractors
1472
- * @param fn The runner function
1473
- * @param filterBlocked Filter blocked extractors
1474
- */
1475
- run<T = unknown>(fn: ExtractorExecutionFN<T>, filterBlocked?: boolean): Promise<ExtractorExecutionResult<T> | ExtractorExecutionResult<false> | undefined>;
1476
- }
1477
- interface ExtractorExecutionResult<T = unknown> {
1478
- extractor: BaseExtractor;
1479
- error: Error | null;
1480
- result: T;
1481
- }
1399
+ declare const knownExtractorKeys: readonly ["SpotifyExtractor", "AppleMusicExtractor", "SoundCloudExtractor", "YouTubeExtractor", "VimeoExtractor", "ReverbnationExtractor", "AttachmentExtractor"];
1400
+ interface ExtractorExecutionEvents {
1401
+ /**
1402
+ * Emitted when a extractor is registered
1403
+ * @param context The context where extractor was registered
1404
+ * @param extractor The extractor that was registered
1405
+ */
1406
+ registered: (context: ExtractorExecutionContext, extractor: BaseExtractor) => unknown;
1407
+ /**
1408
+ * Emitted when a extractor is unregistered
1409
+ * @param context The context where extractor was unregistered
1410
+ * @param extractor The extractor that was unregistered
1411
+ */
1412
+ unregistered: (context: ExtractorExecutionContext, extractor: BaseExtractor) => unknown;
1413
+ /**
1414
+ * Emitted when a extractor is activated
1415
+ * @param context The context where this event occurred
1416
+ * @param extractor The extractor which was activated
1417
+ */
1418
+ activate: (context: ExtractorExecutionContext, extractor: BaseExtractor) => unknown;
1419
+ /**
1420
+ * Emitted when a extractor is deactivated
1421
+ * @param context The context where this event occurred
1422
+ * @param extractor The extractor which was deactivated
1423
+ */
1424
+ deactivate: (context: ExtractorExecutionContext, extractor: BaseExtractor) => unknown;
1425
+ /**
1426
+ * Emitted when a extractor fails to activate/deactivate
1427
+ * @param context The context where this event occurred
1428
+ * @param extractor The extractor which was deactivated
1429
+ */
1430
+ error: (context: ExtractorExecutionContext, extractor: BaseExtractor, error: Error) => unknown;
1431
+ }
1432
+ declare class ExtractorExecutionContext extends PlayerEventsEmitter<ExtractorExecutionEvents> {
1433
+ player: Player;
1434
+ store: Collection<string, BaseExtractor<object>>;
1435
+ constructor(player: Player);
1436
+ /**
1437
+ * Load default extractors from `@discord-player/extractor`
1438
+ */
1439
+ loadDefault(filter?: (ext: (typeof knownExtractorKeys)[number]) => boolean): Promise<{
1440
+ success: boolean;
1441
+ error: Error;
1442
+ } | {
1443
+ success: boolean;
1444
+ error: null;
1445
+ }>;
1446
+ /**
1447
+ * Validate if the given extractor is registered
1448
+ * @param identifier The extractor identifier
1449
+ */
1450
+ isRegistered(identifier: string): boolean;
1451
+ /**
1452
+ * The size of registered extractors
1453
+ */
1454
+ get size(): number;
1455
+ /**
1456
+ * Get single extractor
1457
+ * @param identifier The extractor to get
1458
+ */
1459
+ get(identifier: string): BaseExtractor<object> | undefined;
1460
+ /**
1461
+ * Register single extractor
1462
+ * @param _extractor The extractor to register
1463
+ * @param options Options supplied to the extractor
1464
+ */
1465
+ register<O extends object, T extends typeof BaseExtractor<O>>(_extractor: T, options: ConstructorParameters<T>['1']): Promise<InstanceType<T> | null>;
1466
+ /**
1467
+ * Unregister single extractor
1468
+ * @param _extractor The extractor to unregister
1469
+ */
1470
+ unregister<K extends string | BaseExtractor>(_extractor: K): Promise<void>;
1471
+ /**
1472
+ * Unregister all extractors
1473
+ */
1474
+ unregisterAll(): Promise<void>;
1475
+ /**
1476
+ * Run all the extractors
1477
+ * @param fn The runner function
1478
+ * @param filterBlocked Filter blocked extractors
1479
+ */
1480
+ run<T = unknown>(fn: ExtractorExecutionFN<T>, filterBlocked?: boolean): Promise<ExtractorExecutionResult<T> | ExtractorExecutionResult<false> | undefined>;
1481
+ }
1482
+ interface ExtractorExecutionResult<T = unknown> {
1483
+ extractor: BaseExtractor;
1484
+ error: Error | null;
1485
+ result: T;
1486
+ }
1482
1487
  type ExtractorExecutionFN<T = unknown> = (extractor: BaseExtractor) => Promise<T | boolean>;
1483
1488
 
1484
- declare class BaseExtractor<T extends object = object> {
1485
- context: ExtractorExecutionContext;
1486
- options: T;
1487
- /**
1488
- * Identifier for this extractor
1489
- */
1490
- static identifier: string;
1491
- /**
1492
- * Handle bridge query creation
1493
- * @param track The track to build query for
1494
- */
1495
- createBridgeQuery: (track: Track) => string;
1496
- /**
1497
- * Extractor constructor
1498
- * @param context Context that instantiated this extractor
1499
- * @param options Initialization options for this extractor
1500
- */
1501
- constructor(context: ExtractorExecutionContext, options?: T);
1502
- /**
1503
- * Identifier of this extractor
1504
- */
1505
- get identifier(): string;
1506
- /**
1507
- * Reconfigures this extractor
1508
- * @param options The new options to apply
1509
- */
1510
- reconfigure(options: T): Promise<void>;
1511
- /**
1512
- * This method will be executed when this extractor is activated
1513
- */
1514
- activate(): Promise<void>;
1515
- /**
1516
- * This method will be executed when this extractor is deactivated
1517
- */
1518
- deactivate(): Promise<void>;
1519
- /**
1520
- * Validate incoming query
1521
- * @param query The query to validate
1522
- */
1523
- validate(query: string, type?: SearchQueryType | null): Promise<boolean>;
1524
- /**
1525
- * Stream the given track
1526
- * @param info The track to stream
1527
- */
1528
- stream(info: Track): Promise<Readable | string>;
1529
- /**
1530
- * Handle the given query
1531
- * @param query The query to handle
1532
- */
1533
- handle(query: string, context: ExtractorSearchContext): Promise<ExtractorInfo>;
1534
- /**
1535
- * Get related tracks for the given track
1536
- * @param track The track source
1537
- */
1538
- getRelatedTracks(track: Track): Promise<ExtractorInfo>;
1539
- /**
1540
- * A stream middleware to handle streams before passing it to the player
1541
- * @param stream The incoming stream
1542
- * @param next The next function
1543
- */
1544
- handlePostStream(stream: Readable, next: NextFunction): void;
1545
- /**
1546
- * Dispatch an event to the player
1547
- * @param event The event to dispatch
1548
- * @param args The data to dispatch
1549
- */
1550
- emit<K extends keyof PlayerEvents>(event: K, ...args: Parameters<PlayerEvents[K]>): boolean;
1551
- /**
1552
- * Create extractor response
1553
- * @param playlist The playlist
1554
- * @param tracks The track array
1555
- */
1556
- createResponse(playlist?: Playlist | null, tracks?: Track[]): ExtractorInfo;
1557
- /**
1558
- * Write debug message
1559
- * @param message The debug message
1560
- */
1561
- debug(message: string): boolean;
1562
- }
1563
- type NextFunction = (error?: Error | null, stream?: Readable) => void;
1564
- interface ExtractorInfo {
1565
- playlist: Playlist | null;
1566
- tracks: Track[];
1567
- }
1568
- interface ExtractorSearchContext {
1569
- type?: SearchQueryType | null;
1570
- requestedBy?: User | null;
1571
- requestOptions?: RequestOptions;
1489
+ declare class BaseExtractor<T extends object = object> {
1490
+ context: ExtractorExecutionContext;
1491
+ options: T;
1492
+ /**
1493
+ * Identifier for this extractor
1494
+ */
1495
+ static identifier: string;
1496
+ /**
1497
+ * Handle bridge query creation
1498
+ * @param track The track to build query for
1499
+ */
1500
+ createBridgeQuery: (track: Track) => string;
1501
+ /**
1502
+ * Extractor constructor
1503
+ * @param context Context that instantiated this extractor
1504
+ * @param options Initialization options for this extractor
1505
+ */
1506
+ constructor(context: ExtractorExecutionContext, options?: T);
1507
+ /**
1508
+ * Identifier of this extractor
1509
+ */
1510
+ get identifier(): string;
1511
+ /**
1512
+ * Reconfigures this extractor
1513
+ * @param options The new options to apply
1514
+ */
1515
+ reconfigure(options: T): Promise<void>;
1516
+ /**
1517
+ * This method will be executed when this extractor is activated
1518
+ */
1519
+ activate(): Promise<void>;
1520
+ /**
1521
+ * This method will be executed when this extractor is deactivated
1522
+ */
1523
+ deactivate(): Promise<void>;
1524
+ /**
1525
+ * Validate incoming query
1526
+ * @param query The query to validate
1527
+ */
1528
+ validate(query: string, type?: SearchQueryType | null): Promise<boolean>;
1529
+ /**
1530
+ * Stream the given track
1531
+ * @param info The track to stream
1532
+ */
1533
+ stream(info: Track): Promise<Readable | string>;
1534
+ /**
1535
+ * Handle the given query
1536
+ * @param query The query to handle
1537
+ */
1538
+ handle(query: string, context: ExtractorSearchContext): Promise<ExtractorInfo>;
1539
+ /**
1540
+ * Get related tracks for the given track
1541
+ * @param track The track source
1542
+ */
1543
+ getRelatedTracks(track: Track, history: GuildQueueHistory): Promise<ExtractorInfo>;
1544
+ /**
1545
+ * A stream middleware to handle streams before passing it to the player
1546
+ * @param stream The incoming stream
1547
+ * @param next The next function
1548
+ */
1549
+ handlePostStream(stream: Readable, next: NextFunction): void;
1550
+ /**
1551
+ * Dispatch an event to the player
1552
+ * @param event The event to dispatch
1553
+ * @param args The data to dispatch
1554
+ */
1555
+ emit<K extends keyof PlayerEvents>(event: K, ...args: Parameters<PlayerEvents[K]>): boolean;
1556
+ /**
1557
+ * Create extractor response
1558
+ * @param playlist The playlist
1559
+ * @param tracks The track array
1560
+ */
1561
+ createResponse(playlist?: Playlist | null, tracks?: Track[]): ExtractorInfo;
1562
+ /**
1563
+ * Write debug message
1564
+ * @param message The debug message
1565
+ */
1566
+ debug(message: string): boolean;
1567
+ /**
1568
+ * IP rotator instance, if available
1569
+ */
1570
+ get routePlanner(): IPRotator | null;
1571
+ }
1572
+ type NextFunction = (error?: Error | null, stream?: Readable) => void;
1573
+ interface ExtractorInfo {
1574
+ playlist: Playlist | null;
1575
+ tracks: Track[];
1576
+ }
1577
+ interface ExtractorSearchContext {
1578
+ type?: SearchQueryType | null;
1579
+ requestedBy?: User | null;
1580
+ requestOptions?: RequestOptions;
1581
+ }
1582
+
1583
+ interface SearchResultData {
1584
+ query: string;
1585
+ queryType?: SearchQueryType | QueryExtractorSearch | null;
1586
+ extractor?: BaseExtractor | null;
1587
+ playlist?: Playlist | null;
1588
+ tracks?: Track[];
1589
+ requestedBy?: User | null;
1590
+ }
1591
+ declare class SearchResult {
1592
+ player: Player;
1593
+ private _data;
1594
+ constructor(player: Player, _data: SearchResultData);
1595
+ setQueryType(type: SearchQueryType | QueryExtractorSearch): this;
1596
+ setRequestedBy(user: User): this;
1597
+ setExtractor(extractor: BaseExtractor): this;
1598
+ setTracks(tracks: Track[]): this;
1599
+ setQuery(query: string): this;
1600
+ setPlaylist(playlist: Playlist): this;
1601
+ /**
1602
+ * The search query
1603
+ */
1604
+ get query(): string;
1605
+ /**
1606
+ * The search query type
1607
+ */
1608
+ get queryType(): SearchQueryType | `ext:${string}`;
1609
+ /**
1610
+ * The extractor
1611
+ */
1612
+ get extractor(): BaseExtractor<object> | null;
1613
+ /**
1614
+ * Playlist result
1615
+ */
1616
+ get playlist(): Playlist | null | undefined;
1617
+ /**
1618
+ * Tracks result
1619
+ */
1620
+ get tracks(): Track<unknown>[];
1621
+ /**
1622
+ * Requested by
1623
+ */
1624
+ get requestedBy(): User | null;
1625
+ /**
1626
+ * Re-execute this search
1627
+ */
1628
+ execute(): Promise<SearchResult>;
1629
+ /**
1630
+ * If this search result is empty
1631
+ */
1632
+ isEmpty(): boolean;
1633
+ /**
1634
+ * If this search result has playlist
1635
+ */
1636
+ hasPlaylist(): boolean;
1637
+ /**
1638
+ * If this search result has tracks
1639
+ */
1640
+ hasTracks(): boolean;
1641
+ /**
1642
+ * JSON representation of this search
1643
+ */
1644
+ toJSON(): {
1645
+ query: string;
1646
+ queryType: SearchQueryType | `ext:${string}`;
1647
+ playlist: PlaylistJSON | null;
1648
+ tracks: TrackJSON[];
1649
+ extractor: string | null;
1650
+ requestedBy: {} | null;
1651
+ };
1572
1652
  }
1573
1653
 
1574
- interface SearchResultData {
1575
- query: string;
1576
- queryType?: SearchQueryType | QueryExtractorSearch | null;
1577
- extractor?: BaseExtractor | null;
1578
- playlist?: Playlist | null;
1579
- tracks?: Track[];
1580
- requestedBy?: User | null;
1581
- }
1582
- declare class SearchResult {
1583
- player: Player;
1584
- private _data;
1585
- constructor(player: Player, _data: SearchResultData);
1586
- setQueryType(type: SearchQueryType | QueryExtractorSearch): this;
1587
- setRequestedBy(user: User): this;
1588
- setExtractor(extractor: BaseExtractor): this;
1589
- setTracks(tracks: Track[]): this;
1590
- setQuery(query: string): this;
1591
- setPlaylist(playlist: Playlist): this;
1592
- /**
1593
- * The search query
1594
- */
1595
- get query(): string;
1596
- /**
1597
- * The search query type
1598
- */
1599
- get queryType(): SearchQueryType | `ext:${string}`;
1600
- /**
1601
- * The extractor
1602
- */
1603
- get extractor(): BaseExtractor<object> | null;
1604
- /**
1605
- * Playlist result
1606
- */
1607
- get playlist(): Playlist | null | undefined;
1608
- /**
1609
- * Tracks result
1610
- */
1611
- get tracks(): Track<unknown>[];
1612
- /**
1613
- * Requested by
1614
- */
1615
- get requestedBy(): User | null;
1616
- /**
1617
- * Re-execute this search
1618
- */
1619
- execute(): Promise<SearchResult>;
1620
- /**
1621
- * If this search result is empty
1622
- */
1623
- isEmpty(): boolean;
1624
- /**
1625
- * If this search result has playlist
1626
- */
1627
- hasPlaylist(): boolean;
1628
- /**
1629
- * If this search result has tracks
1630
- */
1631
- hasTracks(): boolean;
1632
- /**
1633
- * JSON representation of this search
1634
- */
1635
- toJSON(): {
1636
- query: string;
1637
- queryType: SearchQueryType | `ext:${string}`;
1638
- playlist: PlaylistJSON | null;
1639
- tracks: TrackJSON[];
1640
- extractor: string | null;
1641
- requestedBy: {} | null;
1642
- };
1654
+ interface QueryCacheOptions {
1655
+ checkInterval?: number;
1656
+ }
1657
+ interface QueryCacheProvider<T> {
1658
+ getData(): Promise<DiscordPlayerQueryResultCache<T>[]>;
1659
+ addData(data: SearchResult): Promise<void>;
1660
+ resolve(context: QueryCacheResolverContext): Promise<SearchResult>;
1661
+ }
1662
+ declare class QueryCache implements QueryCacheProvider<Track> {
1663
+ #private;
1664
+ player: Player;
1665
+ options: QueryCacheOptions;
1666
+ timer: NodeJS.Timer;
1667
+ constructor(player: Player, options?: QueryCacheOptions);
1668
+ get checkInterval(): number;
1669
+ cleanup(): Promise<void>;
1670
+ clear(): Promise<void>;
1671
+ getData(): Promise<DiscordPlayerQueryResultCache<Track<unknown>>[]>;
1672
+ addData(data: SearchResult): Promise<void>;
1673
+ resolve(context: QueryCacheResolverContext): Promise<SearchResult>;
1674
+ }
1675
+ declare class DiscordPlayerQueryResultCache<T = unknown> {
1676
+ data: T;
1677
+ expireAfter: number;
1678
+ constructor(data: T, expireAfter?: number);
1679
+ hasExpired(): boolean;
1680
+ }
1681
+ interface QueryCacheResolverContext {
1682
+ query: string;
1683
+ requestedBy?: User;
1684
+ queryType?: SearchQueryType | `ext:${string}`;
1643
1685
  }
1644
1686
 
1645
- interface QueryCacheOptions {
1646
- checkInterval?: number;
1647
- }
1648
- interface QueryCacheProvider<T> {
1649
- getData(): Promise<DiscordPlayerQueryResultCache<T>[]>;
1650
- addData(data: SearchResult): Promise<void>;
1651
- resolve(context: QueryCacheResolverContext): Promise<SearchResult>;
1652
- }
1653
- declare class QueryCache implements QueryCacheProvider<Track> {
1654
- #private;
1655
- player: Player;
1656
- options: QueryCacheOptions;
1657
- timer: NodeJS.Timer;
1658
- constructor(player: Player, options?: QueryCacheOptions);
1659
- get checkInterval(): number;
1660
- cleanup(): Promise<void>;
1661
- clear(): Promise<void>;
1662
- getData(): Promise<DiscordPlayerQueryResultCache<Track<unknown>>[]>;
1663
- addData(data: SearchResult): Promise<void>;
1664
- resolve(context: QueryCacheResolverContext): Promise<SearchResult>;
1665
- }
1666
- declare class DiscordPlayerQueryResultCache<T = unknown> {
1667
- data: T;
1668
- expireAfter: number;
1669
- constructor(data: T, expireAfter?: number);
1670
- hasExpired(): boolean;
1671
- }
1672
- interface QueryCacheResolverContext {
1673
- query: string;
1674
- requestedBy?: User;
1675
- queryType?: SearchQueryType | `ext:${string}`;
1687
+ declare class VoiceUtils {
1688
+ player: Player;
1689
+ /**
1690
+ * Voice connection cache to store voice connections of the Player components.
1691
+ * This property is deprecated and will be removed in the future.
1692
+ * It only exists for compatibility reasons.
1693
+ * @deprecated
1694
+ */
1695
+ cache: Collection<Snowflake, StreamDispatcher>;
1696
+ /**
1697
+ * The voice utils constructor
1698
+ */
1699
+ constructor(player: Player);
1700
+ /**
1701
+ * Joins a voice channel, creating basic stream dispatch manager
1702
+ * @param {StageChannel|VoiceChannel} channel The voice channel
1703
+ * @param {object} [options] Join options
1704
+ * @returns {Promise<StreamDispatcher>}
1705
+ */
1706
+ connect(channel: VoiceChannel | StageChannel, options?: {
1707
+ deaf?: boolean;
1708
+ maxTime?: number;
1709
+ queue: GuildQueue;
1710
+ audioPlayer?: AudioPlayer;
1711
+ group?: string;
1712
+ }): Promise<StreamDispatcher>;
1713
+ /**
1714
+ * Joins a voice channel
1715
+ * @param {StageChannel|VoiceChannel} [channel] The voice/stage channel to join
1716
+ * @param {object} [options] Join options
1717
+ * @returns {VoiceConnection}
1718
+ */
1719
+ join(channel: VoiceChannel | StageChannel, options?: {
1720
+ deaf?: boolean;
1721
+ maxTime?: number;
1722
+ group?: string;
1723
+ }): Promise<VoiceConnection>;
1724
+ /**
1725
+ * Disconnects voice connection
1726
+ * @param {VoiceConnection} connection The voice connection
1727
+ * @returns {void}
1728
+ */
1729
+ disconnect(connection: VoiceConnection | StreamDispatcher): void;
1730
+ /**
1731
+ * Returns Discord Player voice connection
1732
+ * @param {Snowflake} guild The guild id
1733
+ * @returns {StreamDispatcher}
1734
+ */
1735
+ getConnection(guild: Snowflake, group?: string): VoiceConnection | undefined;
1676
1736
  }
1677
1737
 
1678
- declare class VoiceUtils {
1679
- player: Player;
1680
- /**
1681
- * Voice connection cache to store voice connections of the Player components.
1682
- * This property is deprecated and will be removed in the future.
1683
- * It only exists for compatibility reasons.
1684
- * @deprecated
1685
- */
1686
- cache: Collection<Snowflake, StreamDispatcher>;
1687
- /**
1688
- * The voice utils constructor
1689
- */
1690
- constructor(player: Player);
1691
- /**
1692
- * Joins a voice channel, creating basic stream dispatch manager
1693
- * @param {StageChannel|VoiceChannel} channel The voice channel
1694
- * @param {object} [options] Join options
1695
- * @returns {Promise<StreamDispatcher>}
1696
- */
1697
- connect(channel: VoiceChannel | StageChannel, options?: {
1698
- deaf?: boolean;
1699
- maxTime?: number;
1700
- queue: GuildQueue;
1701
- audioPlayer?: AudioPlayer;
1702
- group?: string;
1703
- }): Promise<StreamDispatcher>;
1704
- /**
1705
- * Joins a voice channel
1706
- * @param {StageChannel|VoiceChannel} [channel] The voice/stage channel to join
1707
- * @param {object} [options] Join options
1708
- * @returns {VoiceConnection}
1709
- */
1710
- join(channel: VoiceChannel | StageChannel, options?: {
1711
- deaf?: boolean;
1712
- maxTime?: number;
1713
- group?: string;
1714
- }): Promise<VoiceConnection>;
1715
- /**
1716
- * Disconnects voice connection
1717
- * @param {VoiceConnection} connection The voice connection
1718
- * @returns {void}
1719
- */
1720
- disconnect(connection: VoiceConnection | StreamDispatcher): void;
1721
- /**
1722
- * Returns Discord Player voice connection
1723
- * @param {Snowflake} guild The guild id
1724
- * @returns {StreamDispatcher}
1725
- */
1726
- getConnection(guild: Snowflake, group?: string): VoiceConnection | undefined;
1738
+ declare class IPBlock {
1739
+ block: string;
1740
+ usage: number;
1741
+ readonly cidr: string;
1742
+ readonly cidrSize: number;
1743
+ constructor(block: string);
1744
+ consume(): void;
1745
+ }
1746
+ interface IPRotationConfig {
1747
+ /**
1748
+ * IP blocks to use
1749
+ */
1750
+ blocks: string[];
1751
+ /**
1752
+ * IPs to exclude
1753
+ */
1754
+ exclude?: string[];
1755
+ /**
1756
+ * Max retries to find an IP that is not excluded
1757
+ */
1758
+ maxRetries?: number;
1759
+ }
1760
+ declare class IPRotator {
1761
+ #private;
1762
+ config: IPRotationConfig;
1763
+ blocks: IPBlock[];
1764
+ failures: Map<string, number>;
1765
+ MAX_NEXT_RETRIES: number;
1766
+ constructor(config: IPRotationConfig);
1767
+ getIP(): {
1768
+ ip: string;
1769
+ family: 4 | 6;
1770
+ };
1771
+ isFailedOrExcluded(ip: string): boolean;
1772
+ addFailed(ip: string): void;
1773
+ static getRandomIP(address: string, start?: number, end?: number): string;
1727
1774
  }
1728
1775
 
1729
- interface PlayerNodeInitializationResult<T = unknown> {
1730
- track: Track;
1731
- extractor: BaseExtractor | null;
1732
- searchResult: SearchResult;
1733
- queue: GuildQueue<T>;
1734
- }
1735
- type TrackLike = string | Track | SearchResult | Track[] | Playlist;
1736
- interface PlayerNodeInitializerOptions<T> extends SearchOptions {
1737
- nodeOptions?: GuildNodeCreateOptions<T>;
1738
- connectionOptions?: VoiceConnectConfig;
1739
- audioPlayerOptions?: ResourcePlayOptions;
1740
- signal?: AbortSignal;
1741
- afterSearch?: (result: SearchResult) => Promise<SearchResult>;
1742
- }
1743
- type VoiceStateHandler = (player: Player, queue: GuildQueue, oldVoiceState: VoiceState, newVoiceState: VoiceState) => Awaited<void>;
1744
- declare class Player extends PlayerEventsEmitter<PlayerEvents> {
1745
- #private;
1746
- static readonly version: string;
1747
- static _singletonKey: symbol;
1748
- readonly id: string;
1749
- readonly client: Client;
1750
- readonly options: PlayerInitOptions;
1751
- nodes: GuildNodeManager<unknown>;
1752
- readonly voiceUtils: VoiceUtils;
1753
- extractors: ExtractorExecutionContext;
1754
- events: PlayerEventsEmitter<GuildQueueEvents<any>>;
1755
- /**
1756
- * Creates new Discord Player
1757
- * @param {Client} client The Discord Client
1758
- * @param {PlayerInitOptions} [options] The player init options
1759
- */
1760
- constructor(client: Client, options?: PlayerInitOptions);
1761
- get hasDebugger(): boolean;
1762
- /**
1763
- * Override default voice state update handler
1764
- * @param handler The handler callback
1765
- */
1766
- onVoiceStateUpdate(handler: VoiceStateHandler): void;
1767
- debug(m: string): boolean;
1768
- /**
1769
- * Creates discord-player singleton instance.
1770
- * @param client The client that instantiated player
1771
- * @param options Player initializer options
1772
- */
1773
- static singleton(client: Client, options?: Omit<PlayerInitOptions, 'ignoreInstance'>): Player;
1774
- /**
1775
- * Creates new discord-player instance.
1776
- * @param client The client that instantiated player
1777
- * @param options Player initializer options
1778
- */
1779
- static create(client: Client, options?: Omit<PlayerInitOptions, 'ignoreInstance'>): Player;
1780
- /**
1781
- * Get all active master player instances
1782
- */
1783
- static getAllPlayers(): Player[];
1784
- /**
1785
- * Clear all master player instances
1786
- */
1787
- static clearAllPlayers(): void;
1788
- /**
1789
- * The current query cache provider in use
1790
- */
1791
- get queryCache(): QueryCacheProvider<any> | null;
1792
- /**
1793
- * Alias to `Player.nodes`.
1794
- */
1795
- get queues(): GuildNodeManager<unknown>;
1796
- /**
1797
- * Event loop latency in ms. If your bot is laggy and this returns a number above 20ms for example,
1798
- * some expensive task is being executed on the current thread which is slowing down the event loop.
1799
- * @type {number}
1800
- */
1801
- get eventLoopLag(): number;
1802
- /**
1803
- * Generates statistics that could be useful. Statistics generator is still experimental.
1804
- * @example ```typescript
1805
- * const stats = player.generateStatistics();
1806
- *
1807
- * console.log(stats);
1808
- *
1809
- * // outputs something like
1810
- * // {
1811
- * // instances: number,
1812
- * // queuesCount: number,
1813
- * // queryCacheEnabled: boolean,
1814
- * // queues: [
1815
- * // GuildQueueStatisticsMetadata,
1816
- * // GuildQueueStatisticsMetadata,
1817
- * // GuildQueueStatisticsMetadata,
1818
- * // ...
1819
- * // ]
1820
- * // }
1821
- * ```
1822
- */
1823
- generateStatistics(): {
1824
- instances: number;
1825
- queuesCount: number;
1826
- queryCacheEnabled: boolean;
1827
- queues: GuildQueueStatisticsMetadata[];
1828
- };
1829
- /**
1830
- * Destroy every single queues managed by this master player instance
1831
- * @example ```typescript
1832
- * // use me when you want to immediately terminate every single queues in existence 🔪
1833
- * await player.destroy();
1834
- * ```
1835
- */
1836
- destroy(): Promise<void>;
1837
- private _handleVoiceState;
1838
- /**
1839
- * Handles voice state update
1840
- * @param {VoiceState} oldState The old voice state
1841
- * @param {VoiceState} newState The new voice state
1842
- * @returns {void}
1843
- * @example ```typescript
1844
- * // passing voice state update data to this method will trigger voice state handler
1845
- *
1846
- * client.on('voiceStateUpdate', (oldState, newState) => {
1847
- * // this is definitely a rocket science, right here
1848
- * player.handleVoiceState(oldState, newState);
1849
- * });
1850
- * ```
1851
- */
1852
- handleVoiceState(oldState: VoiceState, newState: VoiceState): void;
1853
- /**
1854
- * Lock voice state handler. When this method is called, discord-player will keep using the default voice state update handler, even if custom implementation exists.
1855
- */
1856
- lockVoiceStateHandler(): void;
1857
- /**
1858
- * Unlock voice state handler. When this method is called, discord-player will stop using the default voice state update handler if custom implementation exists.
1859
- */
1860
- unlockVoiceStateHandler(): void;
1861
- /**
1862
- * Checks if voice state handler is locked.
1863
- */
1864
- isVoiceStateHandlerLocked(): boolean;
1865
- /**
1866
- * Initiate audio player
1867
- * @param channel The voice channel on which the music should be played
1868
- * @param query The track or source to play
1869
- * @param options Options for player
1870
- * @example ```typescript
1871
- * // no need to worry about queue management, just use this method 😄
1872
- * const query = 'this is my super cool search query that I want to play';
1873
- *
1874
- * try {
1875
- * const { track } = await player.play(voiceChannel, query);
1876
- * console.log(`🎉 I am playing ${track.title} 🎉`);
1877
- * } catch(e) {
1878
- * console.log(`😭 Failed to play error oh no:\n\n${e}`);
1879
- * }
1880
- * ```
1881
- */
1882
- play<T = unknown>(channel: GuildVoiceChannelResolvable, query: TrackLike, options?: PlayerNodeInitializerOptions<T>): Promise<PlayerNodeInitializationResult<T>>;
1883
- /**
1884
- * Search tracks
1885
- * @param {string | Track | Track[] | Playlist | SearchResult} query The search query
1886
- * @param {SearchOptions} options The search options
1887
- * @returns {Promise<SearchResult>}
1888
- * @example ```typescript
1889
- * const searchQuery = 'pass url or text or discord-player track constructable objects, we got you covered 😎';
1890
- * const result = await player.search(searchQuery);
1891
- *
1892
- * console.log(result); // Logs `SearchResult` object
1893
- * ```
1894
- */
1895
- search(searchQuery: string | Track | Track[] | Playlist | SearchResult, options?: SearchOptions): Promise<SearchResult>;
1896
- /**
1897
- * Generates a report of the dependencies used by the `discord-voip` module. Useful for debugging.
1898
- * @example ```typescript
1899
- * console.log(player.scanDeps());
1900
- * // -> logs dependencies report
1901
- * ```
1902
- * @returns {string}
1903
- */
1904
- scanDeps(): string;
1905
- [Symbol.iterator](): Generator<GuildQueue<unknown>, void, undefined>;
1906
- /**
1907
- * Creates `Playlist` instance
1908
- * @param data The data to initialize a playlist
1909
- */
1910
- createPlaylist(data: PlaylistInitData): Playlist;
1776
+ interface PlayerNodeInitializationResult<T = unknown> {
1777
+ track: Track;
1778
+ extractor: BaseExtractor | null;
1779
+ searchResult: SearchResult;
1780
+ queue: GuildQueue<T>;
1781
+ }
1782
+ type TrackLike = string | Track | SearchResult | Track[] | Playlist;
1783
+ interface PlayerNodeInitializerOptions<T> extends SearchOptions {
1784
+ nodeOptions?: GuildNodeCreateOptions<T>;
1785
+ connectionOptions?: VoiceConnectConfig;
1786
+ audioPlayerOptions?: ResourcePlayOptions;
1787
+ signal?: AbortSignal;
1788
+ afterSearch?: (result: SearchResult) => Promise<SearchResult>;
1789
+ }
1790
+ type VoiceStateHandler = (player: Player, queue: GuildQueue, oldVoiceState: VoiceState, newVoiceState: VoiceState) => Awaited<void>;
1791
+ declare class Player extends PlayerEventsEmitter<PlayerEvents> {
1792
+ #private;
1793
+ static readonly version: string;
1794
+ static _singletonKey: symbol;
1795
+ readonly id: string;
1796
+ readonly client: Client;
1797
+ readonly options: PlayerInitOptions;
1798
+ nodes: GuildNodeManager<unknown>;
1799
+ readonly voiceUtils: VoiceUtils;
1800
+ extractors: ExtractorExecutionContext;
1801
+ events: PlayerEventsEmitter<GuildQueueEvents<any>>;
1802
+ routePlanner: IPRotator | null;
1803
+ /**
1804
+ * Creates new Discord Player
1805
+ * @param {Client} client The Discord Client
1806
+ * @param {PlayerInitOptions} [options] The player init options
1807
+ */
1808
+ constructor(client: Client, options?: PlayerInitOptions);
1809
+ get hasDebugger(): boolean;
1810
+ /**
1811
+ * Override default voice state update handler
1812
+ * @param handler The handler callback
1813
+ */
1814
+ onVoiceStateUpdate(handler: VoiceStateHandler): void;
1815
+ debug(m: string): boolean;
1816
+ /**
1817
+ * Creates discord-player singleton instance.
1818
+ * @param client The client that instantiated player
1819
+ * @param options Player initializer options
1820
+ */
1821
+ static singleton(client: Client, options?: Omit<PlayerInitOptions, 'ignoreInstance'>): Player;
1822
+ /**
1823
+ * Creates new discord-player instance.
1824
+ * @param client The client that instantiated player
1825
+ * @param options Player initializer options
1826
+ */
1827
+ static create(client: Client, options?: Omit<PlayerInitOptions, 'ignoreInstance'>): Player;
1828
+ /**
1829
+ * Get all active master player instances
1830
+ */
1831
+ static getAllPlayers(): Player[];
1832
+ /**
1833
+ * Clear all master player instances
1834
+ */
1835
+ static clearAllPlayers(): void;
1836
+ /**
1837
+ * The current query cache provider in use
1838
+ */
1839
+ get queryCache(): QueryCacheProvider<any> | null;
1840
+ /**
1841
+ * Alias to `Player.nodes`.
1842
+ */
1843
+ get queues(): GuildNodeManager<unknown>;
1844
+ /**
1845
+ * Event loop latency in ms. If your bot is laggy and this returns a number above 20ms for example,
1846
+ * some expensive task is being executed on the current thread which is slowing down the event loop.
1847
+ * @type {number}
1848
+ */
1849
+ get eventLoopLag(): number;
1850
+ /**
1851
+ * Generates statistics that could be useful. Statistics generator is still experimental.
1852
+ * @example ```typescript
1853
+ * const stats = player.generateStatistics();
1854
+ *
1855
+ * console.log(stats);
1856
+ *
1857
+ * // outputs something like
1858
+ * // {
1859
+ * // instances: number,
1860
+ * // queuesCount: number,
1861
+ * // queryCacheEnabled: boolean,
1862
+ * // queues: [
1863
+ * // GuildQueueStatisticsMetadata,
1864
+ * // GuildQueueStatisticsMetadata,
1865
+ * // GuildQueueStatisticsMetadata,
1866
+ * // ...
1867
+ * // ]
1868
+ * // }
1869
+ * ```
1870
+ */
1871
+ generateStatistics(): {
1872
+ instances: number;
1873
+ queuesCount: number;
1874
+ queryCacheEnabled: boolean;
1875
+ queues: GuildQueueStatisticsMetadata[];
1876
+ };
1877
+ /**
1878
+ * Destroy every single queues managed by this master player instance
1879
+ * @example ```typescript
1880
+ * // use me when you want to immediately terminate every single queues in existence 🔪
1881
+ * await player.destroy();
1882
+ * ```
1883
+ */
1884
+ destroy(): Promise<void>;
1885
+ private _handleVoiceState;
1886
+ /**
1887
+ * Handles voice state update
1888
+ * @param {VoiceState} oldState The old voice state
1889
+ * @param {VoiceState} newState The new voice state
1890
+ * @returns {void}
1891
+ * @example ```typescript
1892
+ * // passing voice state update data to this method will trigger voice state handler
1893
+ *
1894
+ * client.on('voiceStateUpdate', (oldState, newState) => {
1895
+ * // this is definitely a rocket science, right here
1896
+ * player.handleVoiceState(oldState, newState);
1897
+ * });
1898
+ * ```
1899
+ */
1900
+ handleVoiceState(oldState: VoiceState, newState: VoiceState): void;
1901
+ /**
1902
+ * Lock voice state handler. When this method is called, discord-player will keep using the default voice state update handler, even if custom implementation exists.
1903
+ */
1904
+ lockVoiceStateHandler(): void;
1905
+ /**
1906
+ * Unlock voice state handler. When this method is called, discord-player will stop using the default voice state update handler if custom implementation exists.
1907
+ */
1908
+ unlockVoiceStateHandler(): void;
1909
+ /**
1910
+ * Checks if voice state handler is locked.
1911
+ */
1912
+ isVoiceStateHandlerLocked(): boolean;
1913
+ /**
1914
+ * Initiate audio player
1915
+ * @param channel The voice channel on which the music should be played
1916
+ * @param query The track or source to play
1917
+ * @param options Options for player
1918
+ * @example ```typescript
1919
+ * // no need to worry about queue management, just use this method 😄
1920
+ * const query = 'this is my super cool search query that I want to play';
1921
+ *
1922
+ * try {
1923
+ * const { track } = await player.play(voiceChannel, query);
1924
+ * console.log(`🎉 I am playing ${track.title} 🎉`);
1925
+ * } catch(e) {
1926
+ * console.log(`😭 Failed to play error oh no:\n\n${e}`);
1927
+ * }
1928
+ * ```
1929
+ */
1930
+ play<T = unknown>(channel: GuildVoiceChannelResolvable, query: TrackLike, options?: PlayerNodeInitializerOptions<T>): Promise<PlayerNodeInitializationResult<T>>;
1931
+ /**
1932
+ * Search tracks
1933
+ * @param {string | Track | Track[] | Playlist | SearchResult} query The search query
1934
+ * @param {SearchOptions} options The search options
1935
+ * @returns {Promise<SearchResult>}
1936
+ * @example ```typescript
1937
+ * const searchQuery = 'pass url or text or discord-player track constructable objects, we got you covered 😎';
1938
+ * const result = await player.search(searchQuery);
1939
+ *
1940
+ * console.log(result); // Logs `SearchResult` object
1941
+ * ```
1942
+ */
1943
+ search(searchQuery: string | Track | Track[] | Playlist | SearchResult, options?: SearchOptions): Promise<SearchResult>;
1944
+ /**
1945
+ * Generates a report of the dependencies used by the `discord-voip` module. Useful for debugging.
1946
+ * @example ```typescript
1947
+ * console.log(player.scanDeps());
1948
+ * // -> logs dependencies report
1949
+ * ```
1950
+ * @returns {string}
1951
+ */
1952
+ scanDeps(): string;
1953
+ [Symbol.iterator](): Generator<GuildQueue<unknown>, void, undefined>;
1954
+ /**
1955
+ * Creates `Playlist` instance
1956
+ * @param data The data to initialize a playlist
1957
+ */
1958
+ createPlaylist(data: PlaylistInitData): Playlist;
1911
1959
  }
1912
1960
 
1913
- interface GuildNodeCreateOptions<T = unknown> {
1914
- strategy?: QueueStrategy;
1915
- volume?: number | boolean;
1916
- equalizer?: EqualizerBand[] | boolean;
1917
- a_filter?: PCMFilters[] | boolean;
1918
- biquad?: BiquadFilters | boolean;
1919
- resampler?: number | boolean;
1920
- disableHistory?: boolean;
1921
- skipOnNoStream?: boolean;
1922
- onBeforeCreateStream?: OnBeforeCreateStreamHandler;
1923
- onAfterCreateStream?: OnAfterCreateStreamHandler;
1924
- repeatMode?: QueueRepeatMode;
1925
- pauseOnEmpty?: boolean;
1926
- leaveOnEmpty?: boolean;
1927
- leaveOnEmptyCooldown?: number;
1928
- leaveOnEnd?: boolean;
1929
- leaveOnEndCooldown?: number;
1930
- leaveOnStop?: boolean;
1931
- leaveOnStopCooldown?: number;
1932
- metadata?: T | null;
1933
- selfDeaf?: boolean;
1934
- connectionTimeout?: number;
1935
- defaultFFmpegFilters?: FiltersName[];
1936
- bufferingTimeout?: number;
1937
- noEmitInsert?: boolean;
1938
- maxSize?: number;
1939
- maxHistorySize?: number;
1940
- preferBridgedMetadata?: boolean;
1941
- }
1942
- type NodeResolvable = GuildQueue | GuildResolvable;
1943
- declare class GuildNodeManager<Meta = unknown> {
1944
- player: Player;
1945
- cache: Collection<string, GuildQueue<unknown>>;
1946
- constructor(player: Player);
1947
- /**
1948
- * Create guild queue if it does not exist
1949
- * @param guild The guild which will be the owner of the queue
1950
- * @param options Queue initializer options
1951
- */
1952
- create<T = Meta>(guild: GuildResolvable, options?: GuildNodeCreateOptions<T>): GuildQueue<T>;
1953
- /**
1954
- * Get existing queue
1955
- * @param node Queue resolvable
1956
- */
1957
- get<T = Meta>(node: NodeResolvable): GuildQueue<T> | null;
1958
- /**
1959
- * Check if a queue exists
1960
- * @param node Queue resolvable
1961
- */
1962
- has(node: NodeResolvable): boolean;
1963
- /**
1964
- * Delete queue
1965
- * @param node Queue resolvable
1966
- */
1967
- delete(node: NodeResolvable): boolean;
1968
- /**
1969
- * Resolve queue
1970
- * @param node Queue resolvable
1971
- */
1972
- resolve<T = Meta>(node: NodeResolvable): GuildQueue<unknown> | undefined;
1973
- /**
1974
- * Resolve queue id
1975
- * @param node Queue resolvable
1976
- */
1977
- resolveId(node: NodeResolvable): string | null;
1961
+ interface GuildNodeCreateOptions<T = unknown> {
1962
+ strategy?: QueueStrategy;
1963
+ volume?: number;
1964
+ equalizer?: EqualizerBand[];
1965
+ a_filter?: PCMFilters[];
1966
+ biquad?: BiquadFilters;
1967
+ resampler?: number;
1968
+ disableHistory?: boolean;
1969
+ skipOnNoStream?: boolean;
1970
+ onBeforeCreateStream?: OnBeforeCreateStreamHandler;
1971
+ onAfterCreateStream?: OnAfterCreateStreamHandler;
1972
+ repeatMode?: QueueRepeatMode;
1973
+ pauseOnEmpty?: boolean;
1974
+ leaveOnEmpty?: boolean;
1975
+ leaveOnEmptyCooldown?: number;
1976
+ leaveOnEnd?: boolean;
1977
+ leaveOnEndCooldown?: number;
1978
+ leaveOnStop?: boolean;
1979
+ leaveOnStopCooldown?: number;
1980
+ metadata?: T | null;
1981
+ selfDeaf?: boolean;
1982
+ connectionTimeout?: number;
1983
+ defaultFFmpegFilters?: FiltersName[];
1984
+ bufferingTimeout?: number;
1985
+ noEmitInsert?: boolean;
1986
+ maxSize?: number;
1987
+ maxHistorySize?: number;
1988
+ preferBridgedMetadata?: boolean;
1989
+ disableVolume?: boolean;
1990
+ disableEqualizer?: boolean;
1991
+ disableFilterer?: boolean;
1992
+ disableBiquad?: boolean;
1993
+ disableResampler?: boolean;
1994
+ }
1995
+ type NodeResolvable = GuildQueue | GuildResolvable;
1996
+ declare class GuildNodeManager<Meta = unknown> {
1997
+ player: Player;
1998
+ cache: Collection<string, GuildQueue<unknown>>;
1999
+ constructor(player: Player);
2000
+ /**
2001
+ * Create guild queue if it does not exist
2002
+ * @param guild The guild which will be the owner of the queue
2003
+ * @param options Queue initializer options
2004
+ */
2005
+ create<T = Meta>(guild: GuildResolvable, options?: GuildNodeCreateOptions<T>): GuildQueue<T>;
2006
+ /**
2007
+ * Get existing queue
2008
+ * @param node Queue resolvable
2009
+ */
2010
+ get<T = Meta>(node: NodeResolvable): GuildQueue<T> | null;
2011
+ /**
2012
+ * Check if a queue exists
2013
+ * @param node Queue resolvable
2014
+ */
2015
+ has(node: NodeResolvable): boolean;
2016
+ /**
2017
+ * Delete queue
2018
+ * @param node Queue resolvable
2019
+ */
2020
+ delete(node: NodeResolvable): boolean;
2021
+ /**
2022
+ * Resolve queue
2023
+ * @param node Queue resolvable
2024
+ */
2025
+ resolve<T = Meta>(node: NodeResolvable): GuildQueue<unknown> | undefined;
2026
+ /**
2027
+ * Resolve queue id
2028
+ * @param node Queue resolvable
2029
+ */
2030
+ resolveId(node: NodeResolvable): string | null;
1978
2031
  }
1979
2032
 
1980
- type FiltersName = keyof QueueFilters;
1981
- interface PlayerSearchResult {
1982
- playlist: Playlist | null;
1983
- tracks: Track[];
1984
- }
1985
- /**
1986
- * @typedef {AudioFilters} QueueFilters
1987
- */
1988
- interface QueueFilters {
1989
- bassboost_low?: boolean;
1990
- bassboost?: boolean;
1991
- bassboost_high?: boolean;
1992
- '8D'?: boolean;
1993
- vaporwave?: boolean;
1994
- nightcore?: boolean;
1995
- phaser?: boolean;
1996
- tremolo?: boolean;
1997
- vibrato?: boolean;
1998
- reverse?: boolean;
1999
- treble?: boolean;
2000
- normalizer?: boolean;
2001
- normalizer2?: boolean;
2002
- surrounding?: boolean;
2003
- pulsator?: boolean;
2004
- subboost?: boolean;
2005
- karaoke?: boolean;
2006
- flanger?: boolean;
2007
- gate?: boolean;
2008
- haas?: boolean;
2009
- mcompand?: boolean;
2010
- mono?: boolean;
2011
- mstlr?: boolean;
2012
- mstrr?: boolean;
2013
- compressor?: boolean;
2014
- expander?: boolean;
2015
- softlimiter?: boolean;
2016
- chorus?: boolean;
2017
- chorus2d?: boolean;
2018
- chorus3d?: boolean;
2019
- fadein?: boolean;
2020
- dim?: boolean;
2021
- earrape?: boolean;
2022
- lofi?: boolean;
2023
- }
2024
- /**
2025
- * The track source:
2026
- * - soundcloud
2027
- * - youtube
2028
- * - spotify
2029
- * - apple_music
2030
- * - arbitrary
2031
- * @typedef {string} TrackSource
2032
- */
2033
- type TrackSource = 'soundcloud' | 'youtube' | 'spotify' | 'apple_music' | 'arbitrary';
2034
- /**
2035
- * @typedef {object} RawTrackData
2036
- * @property {string} title The title
2037
- * @property {string} description The description
2038
- * @property {string} author The author
2039
- * @property {string} url The url
2040
- * @property {string} thumbnail The thumbnail
2041
- * @property {string} duration The duration
2042
- * @property {number} views The views
2043
- * @property {User} requestedBy The user who requested this track
2044
- * @property {Playlist} [playlist] The playlist
2045
- * @property {TrackSource} [source="arbitrary"] The source
2046
- * @property {any} [engine] The engine
2047
- * @property {boolean} [live] If this track is live
2048
- * @property {any} [raw] The raw data
2049
- */
2050
- interface RawTrackData {
2051
- title: string;
2052
- description: string;
2053
- author: string;
2054
- url: string;
2055
- thumbnail: string;
2056
- duration: string;
2057
- views: number;
2058
- requestedBy?: User | null;
2059
- playlist?: Playlist;
2060
- source?: TrackSource;
2061
- engine?: any;
2062
- live?: boolean;
2063
- raw?: any;
2064
- queryType?: SearchQueryType;
2065
- }
2066
- /**
2067
- * @typedef {object} TimeData
2068
- * @property {number} days Time in days
2069
- * @property {number} hours Time in hours
2070
- * @property {number} minutes Time in minutes
2071
- * @property {number} seconds Time in seconds
2072
- */
2073
- interface TimeData {
2074
- days: number;
2075
- hours: number;
2076
- minutes: number;
2077
- seconds: number;
2078
- }
2079
- /**
2080
- * @typedef {object} PlayerProgressbarOptions
2081
- * @property {boolean} [timecodes] If it should render time codes
2082
- * @property {boolean} [queue] If it should create progress bar for the whole queue
2083
- * @property {number} [length] The bar length
2084
- * @property {string} [leftChar] The elapsed time track
2085
- * @property {string} [rightChar] The remaining time track
2086
- * @property {string} [separator] The separation between timestamp and line
2087
- * @property {string} [indicator] The indicator
2088
- */
2089
- interface PlayerProgressbarOptions {
2090
- timecodes?: boolean;
2091
- length?: number;
2092
- leftChar?: string;
2093
- rightChar?: string;
2094
- separator?: string;
2095
- indicator?: string;
2096
- queue?: boolean;
2097
- }
2098
- /**
2099
- * The search query type
2100
- * This can be one of:
2101
- * - AUTO
2102
- * - YOUTUBE
2103
- * - YOUTUBE_PLAYLIST
2104
- * - SOUNDCLOUD_TRACK
2105
- * - SOUNDCLOUD_PLAYLIST
2106
- * - SOUNDCLOUD
2107
- * - SPOTIFY_SONG
2108
- * - SPOTIFY_ALBUM
2109
- * - SPOTIFY_PLAYLIST
2110
- * - SPOTIFY_SEARCH
2111
- * - FACEBOOK
2112
- * - VIMEO
2113
- * - ARBITRARY
2114
- * - REVERBNATION
2115
- * - YOUTUBE_SEARCH
2116
- * - YOUTUBE_VIDEO
2117
- * - SOUNDCLOUD_SEARCH
2118
- * - APPLE_MUSIC_SONG
2119
- * - APPLE_MUSIC_ALBUM
2120
- * - APPLE_MUSIC_PLAYLIST
2121
- * - APPLE_MUSIC_SEARCH
2122
- * - FILE
2123
- * - AUTO_SEARCH
2124
- * @typedef {string} QueryType
2125
- */
2126
- declare const QueryType: {
2127
- readonly AUTO: "auto";
2128
- readonly YOUTUBE: "youtube";
2129
- readonly YOUTUBE_PLAYLIST: "youtubePlaylist";
2130
- readonly SOUNDCLOUD_TRACK: "soundcloudTrack";
2131
- readonly SOUNDCLOUD_PLAYLIST: "soundcloudPlaylist";
2132
- readonly SOUNDCLOUD: "soundcloud";
2133
- readonly SPOTIFY_SONG: "spotifySong";
2134
- readonly SPOTIFY_ALBUM: "spotifyAlbum";
2135
- readonly SPOTIFY_PLAYLIST: "spotifyPlaylist";
2136
- readonly SPOTIFY_SEARCH: "spotifySearch";
2137
- readonly FACEBOOK: "facebook";
2138
- readonly VIMEO: "vimeo";
2139
- readonly ARBITRARY: "arbitrary";
2140
- readonly REVERBNATION: "reverbnation";
2141
- readonly YOUTUBE_SEARCH: "youtubeSearch";
2142
- readonly YOUTUBE_VIDEO: "youtubeVideo";
2143
- readonly SOUNDCLOUD_SEARCH: "soundcloudSearch";
2144
- readonly APPLE_MUSIC_SONG: "appleMusicSong";
2145
- readonly APPLE_MUSIC_ALBUM: "appleMusicAlbum";
2146
- readonly APPLE_MUSIC_PLAYLIST: "appleMusicPlaylist";
2147
- readonly APPLE_MUSIC_SEARCH: "appleMusicSearch";
2148
- readonly FILE: "file";
2149
- readonly AUTO_SEARCH: "autoSearch";
2150
- };
2151
- type SearchQueryType = keyof typeof QueryType | (typeof QueryType)[keyof typeof QueryType];
2152
- interface PlayerEvents {
2153
- debug: (message: string) => any;
2154
- error: (error: Error) => any;
2155
- voiceStateUpdate: (queue: GuildQueue, oldState: VoiceState, newState: VoiceState) => any;
2156
- }
2157
- declare enum PlayerEvent {
2158
- debug = "debug",
2159
- error = "error",
2160
- voiceStateUpdate = "voiceStateUpdate"
2161
- }
2162
- /**
2163
- * @typedef {object} PlayOptions
2164
- * @property {boolean} [filtersUpdate=false] If this play was triggered for filters update
2165
- * @property {string[]} [encoderArgs=[]] FFmpeg args passed to encoder
2166
- * @property {number} [seek] Time to seek to before playing
2167
- * @property {boolean} [immediate=false] If it should start playing the provided track immediately
2168
- */
2169
- interface PlayOptions {
2170
- filtersUpdate?: boolean;
2171
- encoderArgs?: string[];
2172
- seek?: number;
2173
- immediate?: boolean;
2174
- }
2175
- type QueryExtractorSearch = `ext:${string}`;
2176
- /**
2177
- * @typedef {object} SearchOptions
2178
- * @property {UserResolvable} requestedBy The user who requested this search
2179
- * @property {typeof QueryType|string} [searchEngine='auto'] The query search engine, can be extractor name to target specific one (custom)
2180
- * @property {string[]} [blockExtractors[]] List of the extractors to block
2181
- * @property {boolean} [ignoreCache] If it should ignore query cache lookup
2182
- * @property {SearchQueryType} [fallbackSearchEngine='autoSearch'] Fallback search engine to use
2183
- */
2184
- interface SearchOptions {
2185
- requestedBy?: UserResolvable;
2186
- searchEngine?: SearchQueryType | QueryExtractorSearch;
2187
- blockExtractors?: string[];
2188
- ignoreCache?: boolean;
2189
- fallbackSearchEngine?: (typeof QueryType)[keyof typeof QueryType];
2190
- }
2191
- /**
2192
- * The queue repeat mode. This can be one of:
2193
- * - OFF
2194
- * - TRACK
2195
- * - QUEUE
2196
- * - AUTOPLAY
2197
- * @typedef {number} QueueRepeatMode
2198
- */
2199
- declare enum QueueRepeatMode {
2200
- OFF = 0,
2201
- TRACK = 1,
2202
- QUEUE = 2,
2203
- AUTOPLAY = 3
2204
- }
2205
- /**
2206
- * @typedef {object} PlaylistInitData
2207
- * @property {Track[]} tracks The tracks of this playlist
2208
- * @property {string} title The playlist title
2209
- * @property {string} description The description
2210
- * @property {string} thumbnail The thumbnail
2211
- * @property {album|playlist} type The playlist type: `album` | `playlist`
2212
- * @property {TrackSource} source The playlist source
2213
- * @property {object} author The playlist author
2214
- * @property {string} [author.name] The author name
2215
- * @property {string} [author.url] The author url
2216
- * @property {string} id The playlist id
2217
- * @property {string} url The playlist url
2218
- * @property {any} [rawPlaylist] The raw playlist data
2219
- */
2220
- interface PlaylistInitData {
2221
- tracks: Track[];
2222
- title: string;
2223
- description: string;
2224
- thumbnail: string;
2225
- type: 'album' | 'playlist';
2226
- source: TrackSource;
2227
- author: {
2228
- name: string;
2229
- url: string;
2230
- };
2231
- id: string;
2232
- url: string;
2233
- rawPlaylist?: any;
2234
- }
2235
- /**
2236
- * @typedef {object} TrackJSON
2237
- * @property {string} title The track title
2238
- * @property {string} description The track description
2239
- * @property {string} author The author
2240
- * @property {string} url The url
2241
- * @property {string} thumbnail The thumbnail
2242
- * @property {string} duration The duration
2243
- * @property {number} durationMS The duration in ms
2244
- * @property {number} views The views count
2245
- * @property {Snowflake} requestedBy The id of the user who requested this track
2246
- * @property {PlaylistJSON} [playlist] The playlist info (if any)
2247
- */
2248
- interface TrackJSON {
2249
- id: Snowflake;
2250
- title: string;
2251
- description: string;
2252
- author: string;
2253
- url: string;
2254
- thumbnail: string;
2255
- duration: string;
2256
- durationMS: number;
2257
- views: number;
2258
- requestedBy: Snowflake;
2259
- playlist?: PlaylistJSON;
2260
- }
2261
- /**
2262
- * @typedef {object} PlaylistJSON
2263
- * @property {string} id The playlist id
2264
- * @property {string} url The playlist url
2265
- * @property {string} title The playlist title
2266
- * @property {string} description The playlist description
2267
- * @property {string} thumbnail The thumbnail
2268
- * @property {album|playlist} type The playlist type: `album` | `playlist`
2269
- * @property {TrackSource} source The track source
2270
- * @property {object} author The playlist author
2271
- * @property {string} [author.name] The author name
2272
- * @property {string} [author.url] The author url
2273
- * @property {TrackJSON[]} tracks The tracks data (if any)
2274
- */
2275
- interface PlaylistJSON {
2276
- id: string;
2277
- url: string;
2278
- title: string;
2279
- description: string;
2280
- thumbnail: string;
2281
- type: 'album' | 'playlist';
2282
- source: TrackSource;
2283
- author: {
2284
- name: string;
2285
- url: string;
2286
- };
2287
- tracks: TrackJSON[];
2288
- }
2289
- /**
2290
- * @typedef {object} PlayerInitOptions
2291
- * @property {YTDLDownloadOptions} [ytdlOptions] The options passed to `ytdl-core`
2292
- * @property {number} [connectionTimeout=20000] The voice connection timeout
2293
- * @property {boolean} [lagMonitor=30000] Time in ms to re-monitor event loop lag
2294
- * @property {boolean} [lockVoiceStateHandler] Prevent voice state handler from being overridden
2295
- * @property {string[]} [blockExtractors] List of extractors to disable querying metadata from
2296
- * @property {string[]} [blockStreamFrom] List of extractors to disable streaming from
2297
- * @property {QueryCache | null} [queryCache] Query cache provider
2298
- * @property {boolean} [ignoreInstance] Ignore player instance
2299
- * @property {boolean} [useLegacyFFmpeg] Use legacy version of ffmpeg
2300
- * @property {BridgeProvider} [bridgeProvider] Set bridge provider
2301
- */
2302
- interface PlayerInitOptions {
2303
- ytdlOptions?: downloadOptions;
2304
- connectionTimeout?: number;
2305
- lagMonitor?: number;
2306
- lockVoiceStateHandler?: boolean;
2307
- blockExtractors?: string[];
2308
- blockStreamFrom?: string[];
2309
- queryCache?: QueryCacheProvider<any> | null;
2310
- ignoreInstance?: boolean;
2311
- useLegacyFFmpeg?: boolean;
2312
- bridgeProvider?: BridgeProvider;
2033
+ type FiltersName = keyof QueueFilters;
2034
+ interface PlayerSearchResult {
2035
+ playlist: Playlist | null;
2036
+ tracks: Track[];
2037
+ }
2038
+ /**
2039
+ * @typedef {AudioFilters} QueueFilters
2040
+ */
2041
+ interface QueueFilters {
2042
+ bassboost_low?: boolean;
2043
+ bassboost?: boolean;
2044
+ bassboost_high?: boolean;
2045
+ '8D'?: boolean;
2046
+ vaporwave?: boolean;
2047
+ nightcore?: boolean;
2048
+ phaser?: boolean;
2049
+ tremolo?: boolean;
2050
+ vibrato?: boolean;
2051
+ reverse?: boolean;
2052
+ treble?: boolean;
2053
+ normalizer?: boolean;
2054
+ normalizer2?: boolean;
2055
+ surrounding?: boolean;
2056
+ pulsator?: boolean;
2057
+ subboost?: boolean;
2058
+ karaoke?: boolean;
2059
+ flanger?: boolean;
2060
+ gate?: boolean;
2061
+ haas?: boolean;
2062
+ mcompand?: boolean;
2063
+ mono?: boolean;
2064
+ mstlr?: boolean;
2065
+ mstrr?: boolean;
2066
+ compressor?: boolean;
2067
+ expander?: boolean;
2068
+ softlimiter?: boolean;
2069
+ chorus?: boolean;
2070
+ chorus2d?: boolean;
2071
+ chorus3d?: boolean;
2072
+ fadein?: boolean;
2073
+ dim?: boolean;
2074
+ earrape?: boolean;
2075
+ lofi?: boolean;
2076
+ silenceremove?: boolean;
2077
+ }
2078
+ /**
2079
+ * The track source:
2080
+ * - soundcloud
2081
+ * - youtube
2082
+ * - spotify
2083
+ * - apple_music
2084
+ * - arbitrary
2085
+ * @typedef {string} TrackSource
2086
+ */
2087
+ type TrackSource = 'soundcloud' | 'youtube' | 'spotify' | 'apple_music' | 'arbitrary';
2088
+ /**
2089
+ * @typedef {object} RawTrackData
2090
+ * @property {string} title The title
2091
+ * @property {string} description The description
2092
+ * @property {string} author The author
2093
+ * @property {string} url The url
2094
+ * @property {string} thumbnail The thumbnail
2095
+ * @property {string} duration The duration
2096
+ * @property {number} views The views
2097
+ * @property {User} requestedBy The user who requested this track
2098
+ * @property {Playlist} [playlist] The playlist
2099
+ * @property {TrackSource} [source="arbitrary"] The source
2100
+ * @property {any} [engine] The engine
2101
+ * @property {boolean} [live] If this track is live
2102
+ * @property {any} [raw] The raw data
2103
+ */
2104
+ interface RawTrackData {
2105
+ title: string;
2106
+ description: string;
2107
+ author: string;
2108
+ url: string;
2109
+ thumbnail: string;
2110
+ duration: string;
2111
+ views: number;
2112
+ requestedBy?: User | null;
2113
+ playlist?: Playlist;
2114
+ source?: TrackSource;
2115
+ engine?: any;
2116
+ live?: boolean;
2117
+ raw?: any;
2118
+ queryType?: SearchQueryType;
2119
+ }
2120
+ /**
2121
+ * @typedef {object} TimeData
2122
+ * @property {number} days Time in days
2123
+ * @property {number} hours Time in hours
2124
+ * @property {number} minutes Time in minutes
2125
+ * @property {number} seconds Time in seconds
2126
+ */
2127
+ interface TimeData {
2128
+ days: number;
2129
+ hours: number;
2130
+ minutes: number;
2131
+ seconds: number;
2132
+ }
2133
+ /**
2134
+ * @typedef {object} PlayerProgressbarOptions
2135
+ * @property {boolean} [timecodes] If it should render time codes
2136
+ * @property {boolean} [queue] If it should create progress bar for the whole queue
2137
+ * @property {number} [length] The bar length
2138
+ * @property {string} [leftChar] The elapsed time track
2139
+ * @property {string} [rightChar] The remaining time track
2140
+ * @property {string} [separator] The separation between timestamp and line
2141
+ * @property {string} [indicator] The indicator
2142
+ */
2143
+ interface PlayerProgressbarOptions {
2144
+ timecodes?: boolean;
2145
+ length?: number;
2146
+ leftChar?: string;
2147
+ rightChar?: string;
2148
+ separator?: string;
2149
+ indicator?: string;
2150
+ queue?: boolean;
2151
+ }
2152
+ /**
2153
+ * The search query type
2154
+ * This can be one of:
2155
+ * - AUTO
2156
+ * - YOUTUBE
2157
+ * - YOUTUBE_PLAYLIST
2158
+ * - SOUNDCLOUD_TRACK
2159
+ * - SOUNDCLOUD_PLAYLIST
2160
+ * - SOUNDCLOUD
2161
+ * - SPOTIFY_SONG
2162
+ * - SPOTIFY_ALBUM
2163
+ * - SPOTIFY_PLAYLIST
2164
+ * - SPOTIFY_SEARCH
2165
+ * - FACEBOOK
2166
+ * - VIMEO
2167
+ * - ARBITRARY
2168
+ * - REVERBNATION
2169
+ * - YOUTUBE_SEARCH
2170
+ * - YOUTUBE_VIDEO
2171
+ * - SOUNDCLOUD_SEARCH
2172
+ * - APPLE_MUSIC_SONG
2173
+ * - APPLE_MUSIC_ALBUM
2174
+ * - APPLE_MUSIC_PLAYLIST
2175
+ * - APPLE_MUSIC_SEARCH
2176
+ * - FILE
2177
+ * - AUTO_SEARCH
2178
+ * @typedef {string} QueryType
2179
+ */
2180
+ declare const QueryType: {
2181
+ readonly AUTO: "auto";
2182
+ readonly YOUTUBE: "youtube";
2183
+ readonly YOUTUBE_PLAYLIST: "youtubePlaylist";
2184
+ readonly SOUNDCLOUD_TRACK: "soundcloudTrack";
2185
+ readonly SOUNDCLOUD_PLAYLIST: "soundcloudPlaylist";
2186
+ readonly SOUNDCLOUD: "soundcloud";
2187
+ readonly SPOTIFY_SONG: "spotifySong";
2188
+ readonly SPOTIFY_ALBUM: "spotifyAlbum";
2189
+ readonly SPOTIFY_PLAYLIST: "spotifyPlaylist";
2190
+ readonly SPOTIFY_SEARCH: "spotifySearch";
2191
+ readonly FACEBOOK: "facebook";
2192
+ readonly VIMEO: "vimeo";
2193
+ readonly ARBITRARY: "arbitrary";
2194
+ readonly REVERBNATION: "reverbnation";
2195
+ readonly YOUTUBE_SEARCH: "youtubeSearch";
2196
+ readonly YOUTUBE_VIDEO: "youtubeVideo";
2197
+ readonly SOUNDCLOUD_SEARCH: "soundcloudSearch";
2198
+ readonly APPLE_MUSIC_SONG: "appleMusicSong";
2199
+ readonly APPLE_MUSIC_ALBUM: "appleMusicAlbum";
2200
+ readonly APPLE_MUSIC_PLAYLIST: "appleMusicPlaylist";
2201
+ readonly APPLE_MUSIC_SEARCH: "appleMusicSearch";
2202
+ readonly FILE: "file";
2203
+ readonly AUTO_SEARCH: "autoSearch";
2204
+ };
2205
+ type SearchQueryType = keyof typeof QueryType | (typeof QueryType)[keyof typeof QueryType];
2206
+ interface PlayerEvents {
2207
+ debug: (message: string) => any;
2208
+ error: (error: Error) => any;
2209
+ voiceStateUpdate: (queue: GuildQueue, oldState: VoiceState, newState: VoiceState) => any;
2210
+ }
2211
+ declare enum PlayerEvent {
2212
+ debug = "debug",
2213
+ error = "error",
2214
+ voiceStateUpdate = "voiceStateUpdate"
2215
+ }
2216
+ /**
2217
+ * @typedef {object} PlayOptions
2218
+ * @property {boolean} [filtersUpdate=false] If this play was triggered for filters update
2219
+ * @property {string[]} [encoderArgs=[]] FFmpeg args passed to encoder
2220
+ * @property {number} [seek] Time to seek to before playing
2221
+ * @property {boolean} [immediate=false] If it should start playing the provided track immediately
2222
+ */
2223
+ interface PlayOptions {
2224
+ filtersUpdate?: boolean;
2225
+ encoderArgs?: string[];
2226
+ seek?: number;
2227
+ immediate?: boolean;
2228
+ }
2229
+ type QueryExtractorSearch = `ext:${string}`;
2230
+ /**
2231
+ * @typedef {object} SearchOptions
2232
+ * @property {UserResolvable} requestedBy The user who requested this search
2233
+ * @property {typeof QueryType|string} [searchEngine='auto'] The query search engine, can be extractor name to target specific one (custom)
2234
+ * @property {string[]} [blockExtractors[]] List of the extractors to block
2235
+ * @property {boolean} [ignoreCache] If it should ignore query cache lookup
2236
+ * @property {SearchQueryType} [fallbackSearchEngine='autoSearch'] Fallback search engine to use
2237
+ * @property {any} [requestOptions] The request options
2238
+ */
2239
+ interface SearchOptions {
2240
+ requestedBy?: UserResolvable;
2241
+ searchEngine?: SearchQueryType | QueryExtractorSearch;
2242
+ blockExtractors?: string[];
2243
+ ignoreCache?: boolean;
2244
+ requestOptions?: any;
2245
+ fallbackSearchEngine?: (typeof QueryType)[keyof typeof QueryType];
2246
+ }
2247
+ /**
2248
+ * The queue repeat mode. This can be one of:
2249
+ * - OFF
2250
+ * - TRACK
2251
+ * - QUEUE
2252
+ * - AUTOPLAY
2253
+ * @typedef {number} QueueRepeatMode
2254
+ */
2255
+ declare enum QueueRepeatMode {
2256
+ OFF = 0,
2257
+ TRACK = 1,
2258
+ QUEUE = 2,
2259
+ AUTOPLAY = 3
2260
+ }
2261
+ /**
2262
+ * @typedef {object} PlaylistInitData
2263
+ * @property {Track[]} tracks The tracks of this playlist
2264
+ * @property {string} title The playlist title
2265
+ * @property {string} description The description
2266
+ * @property {string} thumbnail The thumbnail
2267
+ * @property {album|playlist} type The playlist type: `album` | `playlist`
2268
+ * @property {TrackSource} source The playlist source
2269
+ * @property {object} author The playlist author
2270
+ * @property {string} [author.name] The author name
2271
+ * @property {string} [author.url] The author url
2272
+ * @property {string} id The playlist id
2273
+ * @property {string} url The playlist url
2274
+ * @property {any} [rawPlaylist] The raw playlist data
2275
+ */
2276
+ interface PlaylistInitData {
2277
+ tracks: Track[];
2278
+ title: string;
2279
+ description: string;
2280
+ thumbnail: string;
2281
+ type: 'album' | 'playlist';
2282
+ source: TrackSource;
2283
+ author: {
2284
+ name: string;
2285
+ url: string;
2286
+ };
2287
+ id: string;
2288
+ url: string;
2289
+ rawPlaylist?: any;
2290
+ }
2291
+ /**
2292
+ * @typedef {object} TrackJSON
2293
+ * @property {string} title The track title
2294
+ * @property {string} description The track description
2295
+ * @property {string} author The author
2296
+ * @property {string} url The url
2297
+ * @property {string} thumbnail The thumbnail
2298
+ * @property {string} duration The duration
2299
+ * @property {number} durationMS The duration in ms
2300
+ * @property {number} views The views count
2301
+ * @property {Snowflake} requestedBy The id of the user who requested this track
2302
+ * @property {PlaylistJSON} [playlist] The playlist info (if any)
2303
+ */
2304
+ interface TrackJSON {
2305
+ id: Snowflake;
2306
+ title: string;
2307
+ description: string;
2308
+ author: string;
2309
+ url: string;
2310
+ thumbnail: string;
2311
+ duration: string;
2312
+ durationMS: number;
2313
+ views: number;
2314
+ requestedBy: Snowflake;
2315
+ playlist?: PlaylistJSON;
2316
+ }
2317
+ /**
2318
+ * @typedef {object} PlaylistJSON
2319
+ * @property {string} id The playlist id
2320
+ * @property {string} url The playlist url
2321
+ * @property {string} title The playlist title
2322
+ * @property {string} description The playlist description
2323
+ * @property {string} thumbnail The thumbnail
2324
+ * @property {album|playlist} type The playlist type: `album` | `playlist`
2325
+ * @property {TrackSource} source The track source
2326
+ * @property {object} author The playlist author
2327
+ * @property {string} [author.name] The author name
2328
+ * @property {string} [author.url] The author url
2329
+ * @property {TrackJSON[]} tracks The tracks data (if any)
2330
+ */
2331
+ interface PlaylistJSON {
2332
+ id: string;
2333
+ url: string;
2334
+ title: string;
2335
+ description: string;
2336
+ thumbnail: string;
2337
+ type: 'album' | 'playlist';
2338
+ source: TrackSource;
2339
+ author: {
2340
+ name: string;
2341
+ url: string;
2342
+ };
2343
+ tracks: TrackJSON[];
2344
+ }
2345
+ /**
2346
+ * @typedef {object} PlayerInitOptions
2347
+ * @property {YTDLDownloadOptions} [ytdlOptions] The options passed to `ytdl-core`
2348
+ * @property {number} [connectionTimeout=20000] The voice connection timeout
2349
+ * @property {boolean} [lagMonitor=30000] Time in ms to re-monitor event loop lag
2350
+ * @property {boolean} [lockVoiceStateHandler] Prevent voice state handler from being overridden
2351
+ * @property {string[]} [blockExtractors] List of extractors to disable querying metadata from
2352
+ * @property {string[]} [blockStreamFrom] List of extractors to disable streaming from
2353
+ * @property {QueryCache | null} [queryCache] Query cache provider
2354
+ * @property {boolean} [ignoreInstance] Ignore player instance
2355
+ * @property {boolean} [useLegacyFFmpeg] Use legacy version of ffmpeg
2356
+ * @property {BridgeProvider} [bridgeProvider] Set bridge provider
2357
+ * @property {object} [ipconfig] IP rotator config
2358
+ */
2359
+ interface PlayerInitOptions {
2360
+ ytdlOptions?: downloadOptions;
2361
+ connectionTimeout?: number;
2362
+ lagMonitor?: number;
2363
+ lockVoiceStateHandler?: boolean;
2364
+ blockExtractors?: string[];
2365
+ blockStreamFrom?: string[];
2366
+ queryCache?: QueryCacheProvider<any> | null;
2367
+ ignoreInstance?: boolean;
2368
+ useLegacyFFmpeg?: boolean;
2369
+ bridgeProvider?: BridgeProvider;
2370
+ ipconfig?: IPRotationConfig;
2313
2371
  }
2314
2372
 
2315
- declare class AudioFilters {
2316
- constructor();
2317
- static filters: Record<FiltersName, string>;
2318
- static get<K extends FiltersName>(name: K): Record<keyof QueueFilters, string>[K];
2319
- static has<K extends FiltersName>(name: K): boolean;
2320
- static [Symbol.iterator](): IterableIterator<{
2321
- name: FiltersName;
2322
- value: string;
2323
- }>;
2324
- static get names(): (keyof QueueFilters)[];
2325
- static get length(): number;
2326
- static toString(): string;
2327
- /**
2328
- * Create ffmpeg args from the specified filters name
2329
- * @param filter The filter name
2330
- * @returns
2331
- */
2332
- static create<K extends FiltersName>(filters?: K[]): string;
2333
- /**
2334
- * Defines audio filter
2335
- * @param filterName The name of the filter
2336
- * @param value The ffmpeg args
2337
- */
2338
- static define(filterName: string, value: string): void;
2339
- /**
2340
- * Defines multiple audio filters
2341
- * @param filtersArray Array of filters containing the filter name and ffmpeg args
2342
- */
2343
- static defineBulk(filtersArray: {
2344
- name: string;
2345
- value: string;
2346
- }[]): void;
2373
+ declare class AudioFilters {
2374
+ constructor();
2375
+ static filters: Record<FiltersName, string>;
2376
+ static get<K extends FiltersName>(name: K): Record<keyof QueueFilters, string>[K];
2377
+ static has<K extends FiltersName>(name: K): boolean;
2378
+ static [Symbol.iterator](): IterableIterator<{
2379
+ name: FiltersName;
2380
+ value: string;
2381
+ }>;
2382
+ static get names(): (keyof QueueFilters)[];
2383
+ static get length(): number;
2384
+ static toString(): string;
2385
+ /**
2386
+ * Create ffmpeg args from the specified filters name
2387
+ * @param filter The filter name
2388
+ * @returns
2389
+ */
2390
+ static create<K extends FiltersName>(filters?: K[]): string;
2391
+ /**
2392
+ * Defines audio filter
2393
+ * @param filterName The name of the filter
2394
+ * @param value The ffmpeg args
2395
+ */
2396
+ static define(filterName: string, value: string): void;
2397
+ /**
2398
+ * Defines multiple audio filters
2399
+ * @param filtersArray Array of filters containing the filter name and ffmpeg args
2400
+ */
2401
+ static defineBulk(filtersArray: {
2402
+ name: string;
2403
+ value: string;
2404
+ }[]): void;
2347
2405
  }
2348
2406
 
2349
- declare class Util {
2350
- /**
2351
- * Utils
2352
- */
2353
- private constructor();
2354
- /**
2355
- * Creates duration string
2356
- * @param {object} durObj The duration object
2357
- * @returns {string}
2358
- */
2359
- static durationString(durObj: Record<string, number>): string;
2360
- /**
2361
- * Parses milliseconds to consumable time object
2362
- * @param {number} milliseconds The time in ms
2363
- * @returns {TimeData}
2364
- */
2365
- static parseMS(milliseconds: number): TimeData;
2366
- /**
2367
- * Builds time code
2368
- * @param {TimeData} duration The duration object
2369
- * @returns {string}
2370
- */
2371
- static buildTimeCode(duration: TimeData): string;
2372
- /**
2373
- * Picks last item of the given array
2374
- * @param {any[]} arr The array
2375
- * @returns {any}
2376
- */
2377
- static last<T = any>(arr: T[]): T;
2378
- /**
2379
- * Checks if the voice channel is empty
2380
- * @param {VoiceChannel|StageChannel} channel The voice channel
2381
- * @returns {boolean}
2382
- */
2383
- static isVoiceEmpty(channel: VoiceChannel | StageChannel): boolean;
2384
- /**
2385
- * Safer require
2386
- * @param {string} id Node require id
2387
- * @returns {any}
2388
- */
2389
- static require(id: string): {
2390
- module: any;
2391
- error: null;
2392
- } | {
2393
- module: null;
2394
- error: unknown;
2395
- };
2396
- static import(id: string): Promise<{
2397
- module: any;
2398
- error: null;
2399
- } | {
2400
- module: null;
2401
- error: unknown;
2402
- }>;
2403
- /**
2404
- * Asynchronous timeout
2405
- * @param {number} time The time in ms to wait
2406
- * @returns {Promise<unknown>}
2407
- */
2408
- static wait(time: number): Promise<undefined>;
2409
- static noop(): void;
2410
- static getFetch(): Promise<any>;
2411
- static warn(message: string, code?: string, detail?: string): void;
2412
- static randomChoice<T>(src: T[]): T;
2413
- }
2407
+ declare class Util {
2408
+ /**
2409
+ * Utils
2410
+ */
2411
+ private constructor();
2412
+ /**
2413
+ * Creates duration string
2414
+ * @param {object} durObj The duration object
2415
+ * @returns {string}
2416
+ */
2417
+ static durationString(durObj: Record<string, number>): string;
2418
+ /**
2419
+ * Parses milliseconds to consumable time object
2420
+ * @param {number} milliseconds The time in ms
2421
+ * @returns {TimeData}
2422
+ */
2423
+ static parseMS(milliseconds: number): TimeData;
2424
+ /**
2425
+ * Builds time code
2426
+ * @param {TimeData} duration The duration object
2427
+ * @returns {string}
2428
+ */
2429
+ static buildTimeCode(duration: TimeData): string;
2430
+ /**
2431
+ * Picks last item of the given array
2432
+ * @param {any[]} arr The array
2433
+ * @returns {any}
2434
+ */
2435
+ static last<T = any>(arr: T[]): T;
2436
+ /**
2437
+ * Checks if the voice channel is empty
2438
+ * @param {VoiceChannel|StageChannel} channel The voice channel
2439
+ * @returns {boolean}
2440
+ */
2441
+ static isVoiceEmpty(channel: VoiceChannel | StageChannel): boolean;
2442
+ /**
2443
+ * Safer require
2444
+ * @param {string} id Node require id
2445
+ * @returns {any}
2446
+ */
2447
+ static require(id: string): {
2448
+ module: any;
2449
+ error: null;
2450
+ } | {
2451
+ module: null;
2452
+ error: unknown;
2453
+ };
2454
+ static import(id: string): Promise<{
2455
+ module: any;
2456
+ error: null;
2457
+ } | {
2458
+ module: null;
2459
+ error: unknown;
2460
+ }>;
2461
+ /**
2462
+ * Asynchronous timeout
2463
+ * @param {number} time The time in ms to wait
2464
+ * @returns {Promise<unknown>}
2465
+ */
2466
+ static wait(time: number): Promise<undefined>;
2467
+ static noop(): void;
2468
+ static getFetch(): Promise<any>;
2469
+ static warn(message: string, code?: string, detail?: string): void;
2470
+ static randomChoice<T>(src: T[]): T;
2471
+ }
2414
2472
  declare const VALIDATE_QUEUE_CAP: (queue: GuildQueue, items: Playlist | Track | Track[]) => void;
2415
2473
 
2416
- declare class TypeUtil {
2417
- private constructor();
2418
- static isFunction(t: unknown): t is Function;
2419
- static isNumber(t: unknown): t is number;
2420
- static isString(t: unknown): t is string;
2421
- static isBoolean(t: unknown): t is boolean;
2422
- static isNullish(t: unknown): t is null | undefined;
2423
- static isArray(t: unknown): t is unknown[];
2424
- static isError(t: unknown): t is Error;
2474
+ declare class TypeUtil {
2475
+ private constructor();
2476
+ static isFunction(t: unknown): t is Function;
2477
+ static isNumber(t: unknown): t is number;
2478
+ static isString(t: unknown): t is string;
2479
+ static isBoolean(t: unknown): t is boolean;
2480
+ static isNullish(t: unknown): t is null | undefined;
2481
+ static isArray(t: unknown): t is unknown[];
2482
+ static isError(t: unknown): t is Error;
2425
2483
  }
2426
2484
 
2427
- interface ResolvedQuery {
2428
- type: (typeof QueryType)[keyof typeof QueryType];
2429
- query: string;
2430
- }
2431
- declare class QueryResolver {
2432
- /**
2433
- * Query resolver
2434
- */
2435
- private constructor();
2436
- static get regex(): {
2437
- spotifyAlbumRegex: RegExp;
2438
- spotifyPlaylistRegex: RegExp;
2439
- spotifySongRegex: RegExp;
2440
- vimeoRegex: RegExp;
2441
- reverbnationRegex: RegExp;
2442
- attachmentRegex: RegExp;
2443
- appleMusicAlbumRegex: RegExp;
2444
- appleMusicPlaylistRegex: RegExp;
2445
- appleMusicSongRegex: RegExp;
2446
- soundcloudTrackRegex: RegExp;
2447
- soundcloudPlaylistRegex: RegExp;
2448
- youtubePlaylistRegex: RegExp;
2449
- };
2450
- /**
2451
- * Resolves the given search query
2452
- * @param {string} query The query
2453
- */
2454
- static resolve(query: string, fallbackSearchEngine?: (typeof QueryType)[keyof typeof QueryType]): ResolvedQuery;
2455
- /**
2456
- * Parses vimeo id from url
2457
- * @param {string} query The query
2458
- * @returns {string}
2459
- */
2460
- static getVimeoID(query: string): string | null | undefined;
2461
- static validateId(q: string): boolean;
2462
- static validateURL(q: string): boolean;
2485
+ interface ResolvedQuery {
2486
+ type: (typeof QueryType)[keyof typeof QueryType];
2487
+ query: string;
2488
+ }
2489
+ declare class QueryResolver {
2490
+ /**
2491
+ * Query resolver
2492
+ */
2493
+ private constructor();
2494
+ static get regex(): {
2495
+ spotifyAlbumRegex: RegExp;
2496
+ spotifyPlaylistRegex: RegExp;
2497
+ spotifySongRegex: RegExp;
2498
+ vimeoRegex: RegExp;
2499
+ reverbnationRegex: RegExp;
2500
+ attachmentRegex: RegExp;
2501
+ appleMusicAlbumRegex: RegExp;
2502
+ appleMusicPlaylistRegex: RegExp;
2503
+ appleMusicSongRegex: RegExp;
2504
+ soundcloudTrackRegex: RegExp;
2505
+ soundcloudPlaylistRegex: RegExp;
2506
+ youtubePlaylistRegex: RegExp;
2507
+ };
2508
+ /**
2509
+ * Resolves the given search query
2510
+ * @param {string} query The query
2511
+ */
2512
+ static resolve(query: string, fallbackSearchEngine?: (typeof QueryType)[keyof typeof QueryType]): ResolvedQuery;
2513
+ /**
2514
+ * Parses vimeo id from url
2515
+ * @param {string} query The query
2516
+ * @returns {string}
2517
+ */
2518
+ static getVimeoID(query: string): string | null | undefined;
2519
+ static validateId(q: string): boolean;
2520
+ static validateURL(q: string): boolean;
2463
2521
  }
2464
2522
 
2465
- /**
2466
- * Fetch guild queue history
2467
- * @param node guild queue node resolvable
2468
- */
2523
+ /**
2524
+ * Fetch guild queue history
2525
+ * @param node guild queue node resolvable
2526
+ */
2469
2527
  declare function useHistory<Meta = unknown>(node: NodeResolvable): GuildQueueHistory<Meta> | null;
2470
2528
 
2471
- /**
2472
- * Fetch guild queue player node
2473
- * @param node Guild queue node resolvable
2474
- */
2529
+ /**
2530
+ * Fetch guild queue player node
2531
+ * @param node Guild queue node resolvable
2532
+ */
2475
2533
  declare function usePlayer<Meta = unknown>(node: NodeResolvable): GuildQueuePlayerNode<Meta> | null;
2476
2534
 
2477
- /**
2478
- * Fetch guild queue
2479
- * @param node Guild queue node resolvable
2480
- */
2535
+ /**
2536
+ * Fetch guild queue
2537
+ * @param node Guild queue node resolvable
2538
+ */
2481
2539
  declare function useQueue<Meta = unknown>(node: NodeResolvable): GuildQueue<Meta> | null;
2482
2540
 
2483
- /**
2484
- * Fetch main player instance
2485
- * @deprecated
2486
- */
2487
- declare function useMasterPlayer(): Player | null;
2488
- /**
2489
- * Fetch main player instance
2490
- */
2541
+ /**
2542
+ * Fetch main player instance
2543
+ * @deprecated
2544
+ */
2545
+ declare function useMasterPlayer(): Player | null;
2546
+ /**
2547
+ * Fetch main player instance
2548
+ */
2491
2549
  declare function useMainPlayer(): Player | null;
2492
2550
 
2493
- type SetterFN$1<T, P> = (previous: P) => T;
2494
- /**
2495
- * Fetch or manipulate guild queue metadata
2496
- * @param node Guild queue node resolvable
2497
- */
2551
+ type SetterFN$1<T, P> = (previous: P) => T;
2552
+ /**
2553
+ * Fetch or manipulate guild queue metadata
2554
+ * @param node Guild queue node resolvable
2555
+ */
2498
2556
  declare function useMetadata<T = unknown>(node: NodeResolvable): readonly [() => T, (metadata: T | SetterFN$1<T, T>) => void];
2499
2557
 
2500
- interface TimelineDispatcherOptions {
2501
- ignoreFilters: boolean;
2502
- }
2503
- /**
2504
- * Fetch or manipulate current track
2505
- * @param node Guild queue node resolvable
2506
- * @param options Options for timeline dispatcher
2507
- */
2508
- declare function useTimeline(node: NodeResolvable, options?: Partial<TimelineDispatcherOptions>): {
2509
- readonly timestamp: PlayerTimestamp;
2510
- readonly volume: number;
2511
- readonly paused: boolean;
2512
- readonly track: Track<unknown> | null;
2513
- pause(): boolean;
2514
- resume(): boolean;
2515
- setVolume(vol: number): boolean;
2516
- setPosition(time: number): Promise<boolean>;
2558
+ interface TimelineDispatcherOptions {
2559
+ ignoreFilters: boolean;
2560
+ }
2561
+ /**
2562
+ * Fetch or manipulate current track
2563
+ * @param node Guild queue node resolvable
2564
+ * @param options Options for timeline dispatcher
2565
+ */
2566
+ declare function useTimeline(node: NodeResolvable, options?: Partial<TimelineDispatcherOptions>): {
2567
+ readonly timestamp: PlayerTimestamp;
2568
+ readonly volume: number;
2569
+ readonly paused: boolean;
2570
+ readonly track: Track<unknown> | null;
2571
+ pause(): boolean;
2572
+ resume(): boolean;
2573
+ setVolume(vol: number): boolean;
2574
+ setPosition(time: number): Promise<boolean>;
2517
2575
  } | null;
2518
2576
 
2519
- /**
2520
- * Global onAfterCreateStream handler
2521
- * @param handler The handler callback
2522
- */
2577
+ /**
2578
+ * Global onAfterCreateStream handler
2579
+ * @param handler The handler callback
2580
+ */
2523
2581
  declare function onAfterCreateStream(handler: OnAfterCreateStreamHandler): void;
2524
2582
 
2525
- /**
2526
- * Global onBeforeCreateStream handler
2527
- * @param handler The handler callback
2528
- */
2583
+ /**
2584
+ * Global onBeforeCreateStream handler
2585
+ * @param handler The handler callback
2586
+ */
2529
2587
  declare function onBeforeCreateStream(handler: OnBeforeCreateStreamHandler): void;
2530
2588
 
2531
- type SetterFN = (previous: number) => number;
2532
- /**
2533
- * Fetch or manipulate player volume
2534
- * @param node Guild queue node resolvable
2535
- */
2589
+ type SetterFN = (previous: number) => number;
2590
+ /**
2591
+ * Fetch or manipulate player volume
2592
+ * @param node Guild queue node resolvable
2593
+ */
2536
2594
  declare function useVolume(node: NodeResolvable): readonly [() => number, (volume: number | SetterFN) => boolean | undefined];
2537
2595
 
2538
2596
  declare const instances: Collection<string, Player>;
2539
2597
 
2540
- declare const getPlayer: () => Player | null;
2541
- declare const getQueue: <T = unknown>(node: NodeResolvable) => GuildQueue<T> | null;
2542
- interface HookDeclarationContext {
2543
- getQueue: typeof getQueue;
2544
- getPlayer: typeof getPlayer;
2545
- instances: typeof instances;
2546
- }
2547
- type HookDeclaration<T extends (...args: any[]) => any> = (context: HookDeclarationContext) => T;
2598
+ declare const getPlayer: () => Player | null;
2599
+ declare const getQueue: <T = unknown>(node: NodeResolvable) => GuildQueue<T> | null;
2600
+ interface HookDeclarationContext {
2601
+ getQueue: typeof getQueue;
2602
+ getPlayer: typeof getPlayer;
2603
+ instances: typeof instances;
2604
+ }
2605
+ type HookDeclaration<T extends (...args: any[]) => any> = (context: HookDeclarationContext) => T;
2548
2606
  declare function createHook<T extends HookDeclaration<(...args: any[]) => any>>(hook: T): ReturnType<T>;
2549
2607
 
2550
2608
  declare const version: string;
2551
2609
 
2552
- export { AFilterGraph, AsyncQueue, AsyncQueueAcquisitionOptions, AsyncQueueEntry, AsyncQueueExceptionHandler, AudioFilters, BaseExtractor, CreateStreamOps, DiscordPlayerQueryResultCache, EqualizerConfigurationPreset, ExtractorExecutionContext, ExtractorExecutionEvents, ExtractorExecutionFN, ExtractorExecutionResult, ExtractorInfo, ExtractorSearchContext, FFMPEG_ARGS_PIPED, FFMPEG_ARGS_STRING, FFMPEG_SRATE_REGEX, FFmpegFilterer, FFmpegStreamOptions, FilterGraph, FiltersName, GuildNodeCreateOptions, GuildNodeInit, GuildNodeManager, GuildQueue, GuildQueueAFiltersCache, GuildQueueAudioFilters, GuildQueueEvent, GuildQueueEvents, GuildQueueHistory, GuildQueuePlayerNode, GuildQueueStatistics, GuildQueueStatisticsMetadata, HookDeclaration, HookDeclarationContext, NextFunction, NodeResolvable, OnAfterCreateStreamHandler, OnBeforeCreateStreamHandler, PlayOptions, Player, PlayerEvent, PlayerEvents, PlayerEventsEmitter, PlayerInitOptions, PlayerNodeInitializationResult, PlayerNodeInitializerOptions, PlayerProgressbarOptions, PlayerSearchResult, PlayerTimestamp, PlayerTriggeredReason, Playlist, PlaylistInitData, PlaylistJSON, PostProcessedResult, QueryCache, QueryCacheOptions, QueryCacheProvider, QueryCacheResolverContext, QueryExtractorSearch, QueryResolver, QueryType, QueueFilters, QueueRepeatMode, RawTrackData, RawTrackInit, ResolvedQuery, ResourcePlayOptions, SearchOptions, SearchQueryType, SearchResult, SearchResultData, StreamConfig, StreamDispatcher, TimeData, TimelineDispatcherOptions, Track, TrackJSON, TrackLike, TrackResolvable, TrackSource, TypeUtil, Util, VALIDATE_QUEUE_CAP, VoiceConnectConfig, VoiceEvents, VoiceReceiverNode, VoiceReceiverOptions, VoiceStateHandler, VoiceUtils, WithMetadata, createFFmpegStream, createHook, onAfterCreateStream, onBeforeCreateStream, useHistory, useMainPlayer, useMasterPlayer, useMetadata, usePlayer, useQueue, useTimeline, useVolume, version };
2610
+ export { AFilterGraph, AsyncQueue, AsyncQueueAcquisitionOptions, AsyncQueueEntry, AsyncQueueExceptionHandler, AudioFilters, BaseExtractor, CreateStreamOps, DiscordPlayerQueryResultCache, EqualizerConfigurationPreset, ExtractorExecutionContext, ExtractorExecutionEvents, ExtractorExecutionFN, ExtractorExecutionResult, ExtractorInfo, ExtractorSearchContext, FFMPEG_ARGS_PIPED, FFMPEG_ARGS_STRING, FFMPEG_SRATE_REGEX, FFmpegFilterer, FFmpegStreamOptions, FilterGraph, FiltersName, GuildNodeCreateOptions, GuildNodeInit, GuildNodeManager, GuildQueue, GuildQueueAFiltersCache, GuildQueueAudioFilters, GuildQueueEvent, GuildQueueEvents, GuildQueueHistory, GuildQueuePlayerNode, GuildQueueStatistics, GuildQueueStatisticsMetadata, HookDeclaration, HookDeclarationContext, IPBlock, IPRotationConfig, IPRotator, NextFunction, NodeResolvable, OnAfterCreateStreamHandler, OnBeforeCreateStreamHandler, PlayOptions, Player, PlayerEvent, PlayerEvents, PlayerEventsEmitter, PlayerInitOptions, PlayerNodeInitializationResult, PlayerNodeInitializerOptions, PlayerProgressbarOptions, PlayerSearchResult, PlayerTimestamp, PlayerTriggeredReason, Playlist, PlaylistInitData, PlaylistJSON, PostProcessedResult, QueryCache, QueryCacheOptions, QueryCacheProvider, QueryCacheResolverContext, QueryExtractorSearch, QueryResolver, QueryType, QueueFilters, QueueRepeatMode, RawTrackData, RawTrackInit, ResolvedQuery, ResourcePlayOptions, SearchOptions, SearchQueryType, SearchResult, SearchResultData, StreamConfig, StreamDispatcher, TimeData, TimelineDispatcherOptions, Track, TrackJSON, TrackLike, TrackResolvable, TrackSource, TypeUtil, Util, VALIDATE_QUEUE_CAP, VoiceConnectConfig, VoiceEvents, VoiceReceiverNode, VoiceReceiverOptions, VoiceStateHandler, VoiceUtils, WithMetadata, createFFmpegStream, createHook, onAfterCreateStream, onBeforeCreateStream, useHistory, useMainPlayer, useMasterPlayer, useMetadata, usePlayer, useQueue, useTimeline, useVolume, version };