discord-player 5.2.0 → 5.2.1-dev

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
@@ -5,1179 +5,1182 @@ import { TypedEmitter } from 'tiny-typed-emitter';
5
5
  import { AudioPlayerError, AudioResource, VoiceConnection, AudioPlayer, StreamType, AudioPlayerStatus } from '@discordjs/voice';
6
6
  import { downloadOptions } from 'ytdl-core';
7
7
 
8
- declare class Playlist {
9
- readonly player: Player;
10
- tracks: Track[];
11
- title: string;
12
- description: string;
13
- thumbnail: string;
14
- type: "album" | "playlist";
15
- source: TrackSource;
16
- author: {
17
- name: string;
18
- url: string;
19
- };
20
- id: string;
21
- url: string;
22
- readonly rawPlaylist?: any;
23
- /**
24
- * Playlist constructor
25
- * @param {Player} player The player
26
- * @param {PlaylistInitData} data The data
27
- */
28
- constructor(player: Player, data: PlaylistInitData);
29
- [Symbol.iterator](): Generator<Track, void, undefined>;
30
- /**
31
- * JSON representation of this playlist
32
- * @param {boolean} [withTracks=true] If it should build json with tracks
33
- * @returns {PlaylistJSON}
34
- */
35
- toJSON(withTracks?: boolean): PlaylistJSON;
8
+ declare class Playlist {
9
+ readonly player: Player;
10
+ tracks: Track[];
11
+ title: string;
12
+ description: string;
13
+ thumbnail: string;
14
+ type: "album" | "playlist";
15
+ source: TrackSource;
16
+ author: {
17
+ name: string;
18
+ url: string;
19
+ };
20
+ id: string;
21
+ url: string;
22
+ readonly rawPlaylist?: any;
23
+ /**
24
+ * Playlist constructor
25
+ * @param {Player} player The player
26
+ * @param {PlaylistInitData} data The data
27
+ */
28
+ constructor(player: Player, data: PlaylistInitData);
29
+ [Symbol.iterator](): Generator<Track, void, undefined>;
30
+ /**
31
+ * JSON representation of this playlist
32
+ * @param {boolean} [withTracks=true] If it should build json with tracks
33
+ * @returns {PlaylistJSON}
34
+ */
35
+ toJSON(withTracks?: boolean): PlaylistJSON;
36
36
  }
37
37
 
38
- declare class Track {
39
- player: Player;
40
- title: string;
41
- description: string;
42
- author: string;
43
- url: string;
44
- thumbnail: string;
45
- duration: string;
46
- views: number;
47
- requestedBy: User;
48
- playlist?: Playlist;
49
- readonly raw: RawTrackData;
50
- readonly id: Snowflake;
51
- /**
52
- * Track constructor
53
- * @param {Player} player The player that instantiated this Track
54
- * @param {RawTrackData} data Track data
55
- */
56
- constructor(player: Player, data: RawTrackData);
57
- private _patch;
58
- /**
59
- * The queue in which this track is located
60
- * @type {Queue}
61
- */
62
- get queue(): Queue;
63
- /**
64
- * The track duration in millisecond
65
- * @type {number}
66
- */
67
- get durationMS(): number;
68
- /**
69
- * Returns source of this track
70
- * @type {TrackSource}
71
- */
72
- get source(): TrackSource;
73
- /**
74
- * String representation of this track
75
- * @returns {string}
76
- */
77
- toString(): string;
78
- /**
79
- * Raw JSON representation of this track
80
- * @returns {TrackJSON}
81
- */
82
- toJSON(hidePlaylist?: boolean): TrackJSON;
38
+ declare class Track {
39
+ player: Player;
40
+ title: string;
41
+ description: string;
42
+ author: string;
43
+ url: string;
44
+ thumbnail: string;
45
+ duration: string;
46
+ views: number;
47
+ requestedBy: User;
48
+ playlist?: Playlist;
49
+ readonly raw: RawTrackData;
50
+ readonly id: Snowflake;
51
+ /**
52
+ * Track constructor
53
+ * @param {Player} player The player that instantiated this Track
54
+ * @param {RawTrackData} data Track data
55
+ */
56
+ constructor(player: Player, data: RawTrackData);
57
+ private _patch;
58
+ /**
59
+ * The queue in which this track is located
60
+ * @type {Queue}
61
+ */
62
+ get queue(): Queue;
63
+ /**
64
+ * The track duration in millisecond
65
+ * @type {number}
66
+ */
67
+ get durationMS(): number;
68
+ /**
69
+ * Returns source of this track
70
+ * @type {TrackSource}
71
+ */
72
+ get source(): TrackSource;
73
+ /**
74
+ * String representation of this track
75
+ * @returns {string}
76
+ */
77
+ toString(): string;
78
+ /**
79
+ * Raw JSON representation of this track
80
+ * @returns {TrackJSON}
81
+ */
82
+ toJSON(hidePlaylist?: boolean): TrackJSON;
83
83
  }
84
84
 
85
- interface VoiceEvents {
86
- error: (error: AudioPlayerError) => any;
87
- debug: (message: string) => any;
88
- start: (resource: AudioResource<Track>) => any;
89
- finish: (resource: AudioResource<Track>) => any;
90
- }
91
- declare class StreamDispatcher extends TypedEmitter<VoiceEvents> {
92
- readonly connectionTimeout: number;
93
- readonly voiceConnection: VoiceConnection;
94
- readonly audioPlayer: AudioPlayer;
95
- channel: VoiceChannel | StageChannel;
96
- audioResource?: AudioResource<Track>;
97
- private readyLock;
98
- paused: boolean;
99
- /**
100
- * Creates new connection object
101
- * @param {VoiceConnection} connection The connection
102
- * @param {VoiceChannel|StageChannel} channel The connected channel
103
- * @private
104
- */
105
- constructor(connection: VoiceConnection, channel: VoiceChannel | StageChannel, connectionTimeout?: number);
106
- /**
107
- * Creates stream
108
- * @param {Readable|Duplex|string} src The stream source
109
- * @param {object} [ops={}] Options
110
- * @returns {AudioResource}
111
- */
112
- createStream(src: Readable | Duplex | string, ops?: {
113
- type?: StreamType;
114
- data?: any;
115
- disableVolume?: boolean;
116
- }): AudioResource<Track>;
117
- /**
118
- * The player status
119
- * @type {AudioPlayerStatus}
120
- */
121
- get status(): AudioPlayerStatus;
122
- /**
123
- * Disconnects from voice
124
- * @returns {void}
125
- */
126
- disconnect(): void;
127
- /**
128
- * Stops the player
129
- * @returns {void}
130
- */
131
- end(): void;
132
- /**
133
- * Pauses the stream playback
134
- * @param {boolean} [interpolateSilence=false] If true, the player will play 5 packets of silence after pausing to prevent audio glitches.
135
- * @returns {boolean}
136
- */
137
- pause(interpolateSilence?: boolean): boolean;
138
- /**
139
- * Resumes the stream playback
140
- * @returns {boolean}
141
- */
142
- resume(): boolean;
143
- /**
144
- * Play stream
145
- * @param {AudioResource<Track>} [resource=this.audioResource] The audio resource to play
146
- * @returns {Promise<StreamDispatcher>}
147
- */
148
- playStream(resource?: AudioResource<Track>): Promise<this>;
149
- /**
150
- * Sets playback volume
151
- * @param {number} value The volume amount
152
- * @returns {boolean}
153
- */
154
- setVolume(value: number): boolean;
155
- /**
156
- * The current volume
157
- * @type {number}
158
- */
159
- get volume(): number;
160
- /**
161
- * The playback time
162
- * @type {number}
163
- */
164
- get streamTime(): number;
85
+ interface VoiceEvents {
86
+ error: (error: AudioPlayerError) => any;
87
+ debug: (message: string) => any;
88
+ start: (resource: AudioResource<Track>) => any;
89
+ finish: (resource: AudioResource<Track>) => any;
90
+ }
91
+ declare class StreamDispatcher extends TypedEmitter<VoiceEvents> {
92
+ readonly connectionTimeout: number;
93
+ readonly voiceConnection: VoiceConnection;
94
+ readonly audioPlayer: AudioPlayer;
95
+ channel: VoiceChannel | StageChannel;
96
+ audioResource?: AudioResource<Track>;
97
+ private readyLock;
98
+ paused: boolean;
99
+ /**
100
+ * Creates new connection object
101
+ * @param {VoiceConnection} connection The connection
102
+ * @param {VoiceChannel|StageChannel} channel The connected channel
103
+ * @private
104
+ */
105
+ constructor(connection: VoiceConnection, channel: VoiceChannel | StageChannel, connectionTimeout?: number);
106
+ /**
107
+ * Creates stream
108
+ * @param {Readable|Duplex|string} src The stream source
109
+ * @param {object} [ops={}] Options
110
+ * @returns {AudioResource}
111
+ */
112
+ createStream(src: Readable | Duplex | string, ops?: {
113
+ type?: StreamType;
114
+ data?: any;
115
+ disableVolume?: boolean;
116
+ }): AudioResource<Track>;
117
+ /**
118
+ * The player status
119
+ * @type {AudioPlayerStatus}
120
+ */
121
+ get status(): AudioPlayerStatus;
122
+ /**
123
+ * Disconnects from voice
124
+ * @returns {void}
125
+ */
126
+ disconnect(): void;
127
+ /**
128
+ * Stops the player
129
+ * @returns {void}
130
+ */
131
+ end(): void;
132
+ /**
133
+ * Pauses the stream playback
134
+ * @param {boolean} [interpolateSilence=false] If true, the player will play 5 packets of silence after pausing to prevent audio glitches.
135
+ * @returns {boolean}
136
+ */
137
+ pause(interpolateSilence?: boolean): boolean;
138
+ /**
139
+ * Resumes the stream playback
140
+ * @returns {boolean}
141
+ */
142
+ resume(): boolean;
143
+ /**
144
+ * Play stream
145
+ * @param {AudioResource<Track>} [resource=this.audioResource] The audio resource to play
146
+ * @returns {Promise<StreamDispatcher>}
147
+ */
148
+ playStream(resource?: AudioResource<Track>): Promise<this>;
149
+ /**
150
+ * Sets playback volume
151
+ * @param {number} value The volume amount
152
+ * @returns {boolean}
153
+ */
154
+ setVolume(value: number): boolean;
155
+ /**
156
+ * The current volume
157
+ * @type {number}
158
+ */
159
+ get volume(): number;
160
+ /**
161
+ * The playback time
162
+ * @type {number}
163
+ */
164
+ get streamTime(): number;
165
165
  }
166
166
 
167
- declare class VoiceUtils {
168
- cache: Collection<Snowflake, StreamDispatcher>;
169
- /**
170
- * The voice utils
171
- * @private
172
- */
173
- constructor();
174
- /**
175
- * Joins a voice channel, creating basic stream dispatch manager
176
- * @param {StageChannel|VoiceChannel} channel The voice channel
177
- * @param {object} [options={}] Join options
178
- * @returns {Promise<StreamDispatcher>}
179
- */
180
- connect(channel: VoiceChannel | StageChannel, options?: {
181
- deaf?: boolean;
182
- maxTime?: number;
183
- }): Promise<StreamDispatcher>;
184
- /**
185
- * Joins a voice channel
186
- * @param {StageChannel|VoiceChannel} [channel] The voice/stage channel to join
187
- * @param {object} [options={}] Join options
188
- * @returns {VoiceConnection}
189
- */
190
- join(channel: VoiceChannel | StageChannel, options?: {
191
- deaf?: boolean;
192
- maxTime?: number;
193
- }): Promise<VoiceConnection>;
194
- /**
195
- * Disconnects voice connection
196
- * @param {VoiceConnection} connection The voice connection
197
- * @returns {void}
198
- */
199
- disconnect(connection: VoiceConnection | StreamDispatcher): void;
200
- /**
201
- * Returns Discord Player voice connection
202
- * @param {Snowflake} guild The guild id
203
- * @returns {StreamDispatcher}
204
- */
205
- getConnection(guild: Snowflake): StreamDispatcher;
167
+ declare class VoiceUtils {
168
+ cache: Collection<Snowflake, StreamDispatcher>;
169
+ /**
170
+ * The voice utils
171
+ * @private
172
+ */
173
+ constructor();
174
+ /**
175
+ * Joins a voice channel, creating basic stream dispatch manager
176
+ * @param {StageChannel|VoiceChannel} channel The voice channel
177
+ * @param {object} [options={}] Join options
178
+ * @returns {Promise<StreamDispatcher>}
179
+ */
180
+ connect(channel: VoiceChannel | StageChannel, options?: {
181
+ deaf?: boolean;
182
+ maxTime?: number;
183
+ }): Promise<StreamDispatcher>;
184
+ /**
185
+ * Joins a voice channel
186
+ * @param {StageChannel|VoiceChannel} [channel] The voice/stage channel to join
187
+ * @param {object} [options={}] Join options
188
+ * @returns {VoiceConnection}
189
+ */
190
+ join(channel: VoiceChannel | StageChannel, options?: {
191
+ deaf?: boolean;
192
+ maxTime?: number;
193
+ }): Promise<VoiceConnection>;
194
+ /**
195
+ * Disconnects voice connection
196
+ * @param {VoiceConnection} connection The voice connection
197
+ * @returns {void}
198
+ */
199
+ disconnect(connection: VoiceConnection | StreamDispatcher): void;
200
+ /**
201
+ * Returns Discord Player voice connection
202
+ * @param {Snowflake} guild The guild id
203
+ * @returns {StreamDispatcher}
204
+ */
205
+ getConnection(guild: Snowflake): StreamDispatcher;
206
206
  }
207
207
 
208
- declare class ExtractorModel {
209
- name: string;
210
- private _raw;
211
- /**
212
- * Model for raw Discord Player extractors
213
- * @param {string} extractorName Name of the extractor
214
- * @param {object} data Extractor object
215
- */
216
- constructor(extractorName: string, data: any);
217
- /**
218
- * Method to handle requests from `Player.play()`
219
- * @param {string} query Query to handle
220
- * @returns {Promise<ExtractorModelData>}
221
- */
222
- handle(query: string): Promise<ExtractorModelData>;
223
- /**
224
- * Method used by Discord Player to validate query with this extractor
225
- * @param {string} query The query to validate
226
- * @returns {boolean}
227
- */
228
- validate(query: string): boolean;
229
- /**
230
- * The extractor version
231
- * @type {string}
232
- */
233
- get version(): string;
208
+ declare class ExtractorModel {
209
+ name: string;
210
+ private _raw;
211
+ /**
212
+ * Model for raw Discord Player extractors
213
+ * @param {string} extractorName Name of the extractor
214
+ * @param {object} data Extractor object
215
+ */
216
+ constructor(extractorName: string, data: any);
217
+ /**
218
+ * Method to handle requests from `Player.play()`
219
+ * @param {string} query Query to handle
220
+ * @returns {Promise<ExtractorModelData>}
221
+ */
222
+ handle(query: string): Promise<ExtractorModelData>;
223
+ /**
224
+ * Method used by Discord Player to validate query with this extractor
225
+ * @param {string} query The query to validate
226
+ * @returns {boolean}
227
+ */
228
+ validate(query: string): boolean;
229
+ /**
230
+ * The extractor version
231
+ * @type {string}
232
+ */
233
+ get version(): string;
234
234
  }
235
235
 
236
- declare class Player extends TypedEmitter<PlayerEvents> {
237
- readonly client: Client;
238
- readonly options: PlayerInitOptions;
239
- readonly queues: Collection<string, Queue<unknown>>;
240
- readonly voiceUtils: VoiceUtils;
241
- readonly extractors: Collection<string, ExtractorModel>;
242
- requiredEvents: string[];
243
- /**
244
- * Creates new Discord Player
245
- * @param {Client} client The Discord Client
246
- * @param {PlayerInitOptions} [options={}] The player init options
247
- */
248
- constructor(client: Client, options?: PlayerInitOptions);
249
- /**
250
- * Handles voice state update
251
- * @param {VoiceState} oldState The old voice state
252
- * @param {VoiceState} newState The new voice state
253
- * @returns {void}
254
- * @private
255
- */
256
- private _handleVoiceState;
257
- /**
258
- * Creates a queue for a guild if not available, else returns existing queue
259
- * @param {GuildResolvable} guild The guild
260
- * @param {PlayerOptions} queueInitOptions Queue init options
261
- * @returns {Queue}
262
- */
263
- createQueue<T = unknown>(guild: GuildResolvable, queueInitOptions?: PlayerOptions & {
264
- metadata?: T;
265
- }): Queue<T>;
266
- /**
267
- * Returns the queue if available
268
- * @param {GuildResolvable} guild The guild id
269
- * @returns {Queue}
270
- */
271
- getQueue<T = unknown>(guild: GuildResolvable): Queue<T>;
272
- /**
273
- * Deletes a queue and returns deleted queue object
274
- * @param {GuildResolvable} guild The guild id to remove
275
- * @returns {Queue}
276
- */
277
- deleteQueue<T = unknown>(guild: GuildResolvable): Queue<T>;
278
- /**
279
- * @typedef {object} PlayerSearchResult
280
- * @property {Playlist} [playlist] The playlist (if any)
281
- * @property {Track[]} tracks The tracks
282
- */
283
- /**
284
- * Search tracks
285
- * @param {string|Track} query The search query
286
- * @param {SearchOptions} options The search options
287
- * @returns {Promise<PlayerSearchResult>}
288
- */
289
- search(query: string | Track, options: SearchOptions): Promise<PlayerSearchResult>;
290
- /**
291
- * Registers extractor
292
- * @param {string} extractorName The extractor name
293
- * @param {ExtractorModel|any} extractor The extractor object
294
- * @param {boolean} [force=false] Overwrite existing extractor with this name (if available)
295
- * @returns {ExtractorModel}
296
- */
297
- use(extractorName: string, extractor: ExtractorModel | any, force?: boolean): ExtractorModel;
298
- /**
299
- * Removes registered extractor
300
- * @param {string} extractorName The extractor name
301
- * @returns {ExtractorModel}
302
- */
303
- unuse(extractorName: string): ExtractorModel;
304
- /**
305
- * Generates a report of the dependencies used by the `@discordjs/voice` module. Useful for debugging.
306
- * @returns {string}
307
- */
308
- scanDeps(): string;
309
- emit<U extends keyof PlayerEvents>(eventName: U, ...args: Parameters<PlayerEvents[U]>): boolean;
310
- /**
311
- * Resolves queue
312
- * @param {GuildResolvable|Queue} queueLike Queue like object
313
- * @returns {Queue}
314
- */
315
- resolveQueue<T>(queueLike: GuildResolvable | Queue): Queue<T>;
316
- [Symbol.iterator](): Generator<Queue<unknown>, void, undefined>;
236
+ declare class Player extends TypedEmitter<PlayerEvents> {
237
+ readonly client: Client;
238
+ readonly options: PlayerInitOptions;
239
+ readonly queues: Collection<string, Queue<unknown>>;
240
+ readonly voiceUtils: VoiceUtils;
241
+ readonly extractors: Collection<string, ExtractorModel>;
242
+ requiredEvents: string[];
243
+ /**
244
+ * Creates new Discord Player
245
+ * @param {Client} client The Discord Client
246
+ * @param {PlayerInitOptions} [options={}] The player init options
247
+ */
248
+ constructor(client: Client, options?: PlayerInitOptions);
249
+ /**
250
+ * Handles voice state update
251
+ * @param {VoiceState} oldState The old voice state
252
+ * @param {VoiceState} newState The new voice state
253
+ * @returns {void}
254
+ * @private
255
+ */
256
+ private _handleVoiceState;
257
+ /**
258
+ * Creates a queue for a guild if not available, else returns existing queue
259
+ * @param {GuildResolvable} guild The guild
260
+ * @param {PlayerOptions} queueInitOptions Queue init options
261
+ * @returns {Queue}
262
+ */
263
+ createQueue<T = unknown>(guild: GuildResolvable, queueInitOptions?: PlayerOptions & {
264
+ metadata?: T;
265
+ }): Queue<T>;
266
+ /**
267
+ * Returns the queue if available
268
+ * @param {GuildResolvable} guild The guild id
269
+ * @returns {Queue}
270
+ */
271
+ getQueue<T = unknown>(guild: GuildResolvable): Queue<T>;
272
+ /**
273
+ * Deletes a queue and returns deleted queue object
274
+ * @param {GuildResolvable} guild The guild id to remove
275
+ * @returns {Queue}
276
+ */
277
+ deleteQueue<T = unknown>(guild: GuildResolvable): Queue<T>;
278
+ /**
279
+ * @typedef {object} PlayerSearchResult
280
+ * @property {Playlist} [playlist] The playlist (if any)
281
+ * @property {Track[]} tracks The tracks
282
+ */
283
+ /**
284
+ * Search tracks
285
+ * @param {string|Track} query The search query
286
+ * @param {SearchOptions} options The search options
287
+ * @returns {Promise<PlayerSearchResult>}
288
+ */
289
+ search(query: string | Track, options: SearchOptions): Promise<PlayerSearchResult>;
290
+ /**
291
+ * Registers extractor
292
+ * @param {string} extractorName The extractor name
293
+ * @param {ExtractorModel|any} extractor The extractor object
294
+ * @param {boolean} [force=false] Overwrite existing extractor with this name (if available)
295
+ * @returns {ExtractorModel}
296
+ */
297
+ use(extractorName: string, extractor: ExtractorModel | any, force?: boolean): ExtractorModel;
298
+ /**
299
+ * Removes registered extractor
300
+ * @param {string} extractorName The extractor name
301
+ * @returns {ExtractorModel}
302
+ */
303
+ unuse(extractorName: string): ExtractorModel;
304
+ /**
305
+ * Generates a report of the dependencies used by the `@discordjs/voice` module. Useful for debugging.
306
+ * @returns {string}
307
+ */
308
+ scanDeps(): string;
309
+ emit<U extends keyof PlayerEvents>(eventName: U, ...args: Parameters<PlayerEvents[U]>): boolean;
310
+ /**
311
+ * Resolves queue
312
+ * @param {GuildResolvable|Queue} queueLike Queue like object
313
+ * @returns {Queue}
314
+ */
315
+ resolveQueue<T>(queueLike: GuildResolvable | Queue): Queue<T>;
316
+ [Symbol.iterator](): Generator<Queue<unknown>, void, undefined>;
317
317
  }
318
318
 
319
- declare class Queue<T = unknown> {
320
- #private;
321
- readonly guild: Guild;
322
- readonly player: Player;
323
- connection: StreamDispatcher;
324
- tracks: Track[];
325
- previousTracks: Track[];
326
- options: PlayerOptions;
327
- playing: boolean;
328
- metadata?: T;
329
- repeatMode: QueueRepeatMode;
330
- readonly id: Snowflake;
331
- private _streamTime;
332
- _cooldownsTimeout: Collection<string, NodeJS.Timeout>;
333
- private _activeFilters;
334
- private _filtersUpdate;
335
- onBeforeCreateStream: (track: Track, source: TrackSource, queue: Queue) => Promise<Readable | undefined>;
336
- /**
337
- * Queue constructor
338
- * @param {Player} player The player that instantiated this queue
339
- * @param {Guild} guild The guild that instantiated this queue
340
- * @param {PlayerOptions} [options={}] Player options for the queue
341
- */
342
- constructor(player: Player, guild: Guild, options?: PlayerOptions);
343
- /**
344
- * Returns current track
345
- * @type {Track}
346
- */
347
- get current(): Track;
348
- /**
349
- * If this queue is destroyed
350
- * @type {boolean}
351
- */
352
- get destroyed(): boolean;
353
- /**
354
- * Returns current track
355
- * @returns {Track}
356
- */
357
- nowPlaying(): Track;
358
- /**
359
- * Connects to a voice channel
360
- * @param {GuildChannelResolvable} channel The voice/stage channel
361
- * @returns {Promise<Queue>}
362
- */
363
- connect(channel: GuildChannelResolvable): Promise<this>;
364
- /**
365
- * Destroys this queue
366
- * @param {boolean} [disconnect=this.options.leaveOnStop] If it should leave on destroy
367
- * @returns {void}
368
- */
369
- destroy(disconnect?: boolean): void;
370
- /**
371
- * Skips current track
372
- * @returns {boolean}
373
- */
374
- skip(): boolean;
375
- /**
376
- * Adds single track to the queue
377
- * @param {Track} track The track to add
378
- * @returns {void}
379
- */
380
- addTrack(track: Track): void;
381
- /**
382
- * Adds multiple tracks to the queue
383
- * @param {Track[]} tracks Array of tracks to add
384
- */
385
- addTracks(tracks: Track[]): void;
386
- /**
387
- * Sets paused state
388
- * @param {boolean} paused The paused state
389
- * @returns {boolean}
390
- */
391
- setPaused(paused?: boolean): boolean;
392
- /**
393
- * Sets bitrate
394
- * @param {number|auto} bitrate bitrate to set
395
- * @returns {void}
396
- */
397
- setBitrate(bitrate: number | "auto"): void;
398
- /**
399
- * Sets volume
400
- * @param {number} amount The volume amount
401
- * @returns {boolean}
402
- */
403
- setVolume(amount: number): boolean;
404
- /**
405
- * Sets repeat mode
406
- * @param {QueueRepeatMode} mode The repeat mode
407
- * @returns {boolean}
408
- */
409
- setRepeatMode(mode: QueueRepeatMode): boolean;
410
- /**
411
- * The current volume amount
412
- * @type {number}
413
- */
414
- get volume(): number;
415
- set volume(amount: number);
416
- /**
417
- * The stream time of this queue
418
- * @type {number}
419
- */
420
- get streamTime(): number;
421
- set streamTime(time: number);
422
- /**
423
- * Returns enabled filters
424
- * @returns {AudioFilters}
425
- */
426
- getFiltersEnabled(): (keyof QueueFilters)[];
427
- /**
428
- * Returns disabled filters
429
- * @returns {AudioFilters}
430
- */
431
- getFiltersDisabled(): (keyof QueueFilters)[];
432
- /**
433
- * Sets filters
434
- * @param {QueueFilters} filters Queue filters
435
- * @returns {Promise<void>}
436
- */
437
- setFilters(filters?: QueueFilters): Promise<void>;
438
- /**
439
- * Seeks to the given time
440
- * @param {number} position The position
441
- * @returns {boolean}
442
- */
443
- seek(position: number): Promise<boolean>;
444
- /**
445
- * Plays previous track
446
- * @returns {Promise<void>}
447
- */
448
- back(): Promise<void>;
449
- /**
450
- * Clear this queue
451
- */
452
- clear(): void;
453
- /**
454
- * Stops the player
455
- * @returns {void}
456
- */
457
- stop(): void;
458
- /**
459
- * Shuffles this queue
460
- * @returns {boolean}
461
- */
462
- shuffle(): boolean;
463
- /**
464
- * Removes a track from the queue
465
- * @param {Track|Snowflake|number} track The track to remove
466
- * @returns {Track}
467
- */
468
- remove(track: Track | Snowflake | number): Track;
469
- /**
470
- * Returns the index of the specified track. If found, returns the track index else returns -1.
471
- * @param {number|Track|Snowflake} track The track
472
- * @returns {number}
473
- */
474
- getTrackPosition(track: number | Track | Snowflake): number;
475
- /**
476
- * Jumps to particular track
477
- * @param {Track|number} track The track
478
- * @returns {void}
479
- */
480
- jump(track: Track | number): void;
481
- /**
482
- * Jumps to particular track, removing other tracks on the way
483
- * @param {Track|number} track The track
484
- * @returns {void}
485
- */
486
- skipTo(track: Track | number): void;
487
- /**
488
- * Inserts the given track to specified index
489
- * @param {Track} track The track to insert
490
- * @param {number} [index=0] The index where this track should be
491
- */
492
- insert(track: Track, index?: number): void;
493
- /**
494
- * @typedef {object} PlayerTimestamp
495
- * @property {string} current The current progress
496
- * @property {string} end The total time
497
- * @property {number} progress Progress in %
498
- */
499
- /**
500
- * Returns player stream timestamp
501
- * @returns {PlayerTimestamp}
502
- */
503
- getPlayerTimestamp(): {
504
- current: string;
505
- end: string;
506
- progress: number;
507
- };
508
- /**
509
- * Creates progress bar string
510
- * @param {PlayerProgressbarOptions} options The progress bar options
511
- * @returns {string}
512
- */
513
- createProgressBar(options?: PlayerProgressbarOptions): string;
514
- /**
515
- * Total duration
516
- * @type {Number}
517
- */
518
- get totalTime(): number;
519
- /**
520
- * Play stream in a voice/stage channel
521
- * @param {Track} [src] The track to play (if empty, uses first track from the queue)
522
- * @param {PlayOptions} [options={}] The options
523
- * @returns {Promise<void>}
524
- */
525
- play(src?: Track, options?: PlayOptions): Promise<void>;
526
- /**
527
- * Private method to handle autoplay
528
- * @param {Track} track The source track to find its similar track for autoplay
529
- * @returns {Promise<void>}
530
- * @private
531
- */
532
- private _handleAutoplay;
533
- [Symbol.iterator](): Generator<Track, void, undefined>;
534
- /**
535
- * JSON representation of this queue
536
- * @returns {object}
537
- */
538
- toJSON(): {
539
- id: string;
540
- guild: string;
541
- voiceChannel: string;
542
- options: PlayerOptions;
543
- tracks: TrackJSON[];
544
- };
545
- /**
546
- * String representation of this queue
547
- * @returns {string}
548
- */
549
- toString(): string;
319
+ declare class Queue<T = unknown> {
320
+ #private;
321
+ readonly guild: Guild;
322
+ readonly player: Player;
323
+ connection: StreamDispatcher;
324
+ tracks: Track[];
325
+ previousTracks: Track[];
326
+ options: PlayerOptions;
327
+ playing: boolean;
328
+ metadata?: T;
329
+ repeatMode: QueueRepeatMode;
330
+ readonly id: Snowflake;
331
+ private _streamTime;
332
+ _cooldownsTimeout: Collection<string, NodeJS.Timeout>;
333
+ private _activeFilters;
334
+ private _filtersUpdate;
335
+ onBeforeCreateStream: (track: Track, source: TrackSource, queue: Queue) => Promise<Readable | undefined>;
336
+ /**
337
+ * Queue constructor
338
+ * @param {Player} player The player that instantiated this queue
339
+ * @param {Guild} guild The guild that instantiated this queue
340
+ * @param {PlayerOptions} [options={}] Player options for the queue
341
+ */
342
+ constructor(player: Player, guild: Guild, options?: PlayerOptions);
343
+ /**
344
+ * Returns current track
345
+ * @type {Track}
346
+ */
347
+ get current(): Track;
348
+ /**
349
+ * If this queue is destroyed
350
+ * @type {boolean}
351
+ */
352
+ get destroyed(): boolean;
353
+ /**
354
+ * Returns current track
355
+ * @returns {Track}
356
+ */
357
+ nowPlaying(): Track;
358
+ /**
359
+ * Connects to a voice channel
360
+ * @param {GuildChannelResolvable} channel The voice/stage channel
361
+ * @returns {Promise<Queue>}
362
+ */
363
+ connect(channel: GuildChannelResolvable): Promise<this>;
364
+ /**
365
+ * Destroys this queue
366
+ * @param {boolean} [disconnect=this.options.leaveOnStop] If it should leave on destroy
367
+ * @returns {void}
368
+ */
369
+ destroy(disconnect?: boolean): void;
370
+ /**
371
+ * Skips current track
372
+ * @returns {boolean}
373
+ */
374
+ skip(): boolean;
375
+ /**
376
+ * Adds single track to the queue
377
+ * @param {Track} track The track to add
378
+ * @returns {void}
379
+ */
380
+ addTrack(track: Track): void;
381
+ /**
382
+ * Adds multiple tracks to the queue
383
+ * @param {Track[]} tracks Array of tracks to add
384
+ */
385
+ addTracks(tracks: Track[]): void;
386
+ /**
387
+ * Sets paused state
388
+ * @param {boolean} paused The paused state
389
+ * @returns {boolean}
390
+ */
391
+ setPaused(paused?: boolean): boolean;
392
+ /**
393
+ * Sets bitrate
394
+ * @param {number|auto} bitrate bitrate to set
395
+ * @returns {void}
396
+ */
397
+ setBitrate(bitrate: number | "auto"): void;
398
+ /**
399
+ * Sets volume
400
+ * @param {number} amount The volume amount
401
+ * @returns {boolean}
402
+ */
403
+ setVolume(amount: number): boolean;
404
+ /**
405
+ * Sets repeat mode
406
+ * @param {QueueRepeatMode} mode The repeat mode
407
+ * @returns {boolean}
408
+ */
409
+ setRepeatMode(mode: QueueRepeatMode): boolean;
410
+ /**
411
+ * The current volume amount
412
+ * @type {number}
413
+ */
414
+ get volume(): number;
415
+ set volume(amount: number);
416
+ /**
417
+ * The stream time of this queue
418
+ * @type {number}
419
+ */
420
+ get streamTime(): number;
421
+ set streamTime(time: number);
422
+ /**
423
+ * Returns enabled filters
424
+ * @returns {AudioFilters}
425
+ */
426
+ getFiltersEnabled(): (keyof QueueFilters)[];
427
+ /**
428
+ * Returns disabled filters
429
+ * @returns {AudioFilters}
430
+ */
431
+ getFiltersDisabled(): (keyof QueueFilters)[];
432
+ /**
433
+ * Sets filters
434
+ * @param {QueueFilters} filters Queue filters
435
+ * @returns {Promise<void>}
436
+ */
437
+ setFilters(filters?: QueueFilters): Promise<void>;
438
+ /**
439
+ * Seeks to the given time
440
+ * @param {number} position The position
441
+ * @returns {boolean}
442
+ */
443
+ seek(position: number): Promise<boolean>;
444
+ /**
445
+ * Plays previous track
446
+ * @returns {Promise<void>}
447
+ */
448
+ back(): Promise<void>;
449
+ /**
450
+ * Clear this queue
451
+ */
452
+ clear(): void;
453
+ /**
454
+ * Stops the player
455
+ * @returns {void}
456
+ */
457
+ stop(): void;
458
+ /**
459
+ * Shuffles this queue
460
+ * @returns {boolean}
461
+ */
462
+ shuffle(): boolean;
463
+ /**
464
+ * Removes a track from the queue
465
+ * @param {Track|Snowflake|number} track The track to remove
466
+ * @returns {Track}
467
+ */
468
+ remove(track: Track | Snowflake | number): Track;
469
+ /**
470
+ * Returns the index of the specified track. If found, returns the track index else returns -1.
471
+ * @param {number|Track|Snowflake} track The track
472
+ * @returns {number}
473
+ */
474
+ getTrackPosition(track: number | Track | Snowflake): number;
475
+ /**
476
+ * Jumps to particular track
477
+ * @param {Track|number} track The track
478
+ * @returns {void}
479
+ */
480
+ jump(track: Track | number): void;
481
+ /**
482
+ * Jumps to particular track, removing other tracks on the way
483
+ * @param {Track|number} track The track
484
+ * @returns {void}
485
+ */
486
+ skipTo(track: Track | number): void;
487
+ /**
488
+ * Inserts the given track to specified index
489
+ * @param {Track} track The track to insert
490
+ * @param {number} [index=0] The index where this track should be
491
+ */
492
+ insert(track: Track, index?: number): void;
493
+ /**
494
+ * @typedef {object} PlayerTimestamp
495
+ * @property {string} current The current progress
496
+ * @property {string} end The total time
497
+ * @property {number} progress Progress in %
498
+ */
499
+ /**
500
+ * Returns player stream timestamp
501
+ * @returns {PlayerTimestamp}
502
+ */
503
+ getPlayerTimestamp(): {
504
+ current: string;
505
+ end: string;
506
+ progress: number;
507
+ };
508
+ /**
509
+ * Creates progress bar string
510
+ * @param {PlayerProgressbarOptions} options The progress bar options
511
+ * @returns {string}
512
+ */
513
+ createProgressBar(options?: PlayerProgressbarOptions): string;
514
+ /**
515
+ * Total duration
516
+ * @type {Number}
517
+ */
518
+ get totalTime(): number;
519
+ /**
520
+ * Play stream in a voice/stage channel
521
+ * @param {Track} [src] The track to play (if empty, uses first track from the queue)
522
+ * @param {PlayOptions} [options={}] The options
523
+ * @returns {Promise<void>}
524
+ */
525
+ play(src?: Track, options?: PlayOptions): Promise<void>;
526
+ /**
527
+ * Private method to handle autoplay
528
+ * @param {Track} track The source track to find its similar track for autoplay
529
+ * @returns {Promise<void>}
530
+ * @private
531
+ */
532
+ private _handleAutoplay;
533
+ [Symbol.iterator](): Generator<Track, void, undefined>;
534
+ /**
535
+ * JSON representation of this queue
536
+ * @returns {object}
537
+ */
538
+ toJSON(): {
539
+ id: string;
540
+ guild: string;
541
+ voiceChannel: string;
542
+ options: PlayerOptions;
543
+ tracks: TrackJSON[];
544
+ };
545
+ /**
546
+ * String representation of this queue
547
+ * @returns {string}
548
+ */
549
+ toString(): string;
550
550
  }
551
551
 
552
- declare type FiltersName = keyof QueueFilters;
553
- interface PlayerSearchResult {
554
- playlist: Playlist | null;
555
- tracks: Track[];
556
- }
557
- /**
558
- * @typedef {AudioFilters} QueueFilters
559
- */
560
- interface QueueFilters {
561
- bassboost_low?: boolean;
562
- bassboost?: boolean;
563
- bassboost_high?: boolean;
564
- "8D"?: boolean;
565
- vaporwave?: boolean;
566
- nightcore?: boolean;
567
- phaser?: boolean;
568
- tremolo?: boolean;
569
- vibrato?: boolean;
570
- reverse?: boolean;
571
- treble?: boolean;
572
- normalizer?: boolean;
573
- normalizer2?: boolean;
574
- surrounding?: boolean;
575
- pulsator?: boolean;
576
- subboost?: boolean;
577
- karaoke?: boolean;
578
- flanger?: boolean;
579
- gate?: boolean;
580
- haas?: boolean;
581
- mcompand?: boolean;
582
- mono?: boolean;
583
- mstlr?: boolean;
584
- mstrr?: boolean;
585
- compressor?: boolean;
586
- expander?: boolean;
587
- softlimiter?: boolean;
588
- chorus?: boolean;
589
- chorus2d?: boolean;
590
- chorus3d?: boolean;
591
- fadein?: boolean;
592
- dim?: boolean;
593
- earrape?: boolean;
594
- }
595
- /**
596
- * The track source:
597
- * - soundcloud
598
- * - youtube
599
- * - spotify
600
- * - arbitrary
601
- * @typedef {string} TrackSource
602
- */
603
- declare type TrackSource = "soundcloud" | "youtube" | "spotify" | "arbitrary";
604
- /**
605
- * @typedef {object} RawTrackData
606
- * @property {string} title The title
607
- * @property {string} description The description
608
- * @property {string} author The author
609
- * @property {string} url The url
610
- * @property {string} thumbnail The thumbnail
611
- * @property {string} duration The duration
612
- * @property {number} views The views
613
- * @property {User} requestedBy The user who requested this track
614
- * @property {Playlist} [playlist] The playlist
615
- * @property {TrackSource} [source="arbitrary"] The source
616
- * @property {any} [engine] The engine
617
- * @property {boolean} [live] If this track is live
618
- * @property {any} [raw] The raw data
619
- */
620
- interface RawTrackData {
621
- title: string;
622
- description: string;
623
- author: string;
624
- url: string;
625
- thumbnail: string;
626
- duration: string;
627
- views: number;
628
- requestedBy: User;
629
- playlist?: Playlist;
630
- source?: TrackSource;
631
- engine?: any;
632
- live?: boolean;
633
- raw?: any;
634
- }
635
- /**
636
- * @typedef {object} TimeData
637
- * @property {number} days Time in days
638
- * @property {number} hours Time in hours
639
- * @property {number} minutes Time in minutes
640
- * @property {number} seconds Time in seconds
641
- */
642
- interface TimeData {
643
- days: number;
644
- hours: number;
645
- minutes: number;
646
- seconds: number;
647
- }
648
- /**
649
- * @typedef {object} PlayerProgressbarOptions
650
- * @property {boolean} [timecodes] If it should render time codes
651
- * @property {boolean} [queue] If it should create progress bar for the whole queue
652
- * @property {number} [length] The bar length
653
- * @property {string} [line] The bar track
654
- * @property {string} [indicator] The indicator
655
- */
656
- interface PlayerProgressbarOptions {
657
- timecodes?: boolean;
658
- length?: number;
659
- line?: string;
660
- indicator?: string;
661
- }
662
- /**
663
- * @typedef {object} PlayerOptions
664
- * @property {boolean} [leaveOnEnd=true] If it should leave on end
665
- * @property {boolean} [leaveOnStop=true] If it should leave on stop
666
- * @property {boolean} [leaveOnEmpty=true] If it should leave on empty
667
- * @property {number} [leaveOnEmptyCooldown=1000] The cooldown in ms
668
- * @property {boolean} [autoSelfDeaf=true] If it should set the bot in deaf mode
669
- * @property {YTDLDownloadOptions} [ytdlOptions={}] The youtube download options
670
- * @property {number} [initialVolume=100] The initial player volume
671
- * @property {number} [bufferingTimeout=3000] Buffering timeout for the stream
672
- * @property {boolean} [spotifyBridge=true] If player should bridge spotify source to youtube
673
- * @property {boolean} [disableVolume=false] If player should disable inline volume
674
- * @property {Function} [onBeforeCreateStream] Runs before creating stream
675
- */
676
- interface PlayerOptions {
677
- leaveOnEnd?: boolean;
678
- leaveOnStop?: boolean;
679
- leaveOnEmpty?: boolean;
680
- leaveOnEmptyCooldown?: number;
681
- autoSelfDeaf?: boolean;
682
- ytdlOptions?: downloadOptions;
683
- initialVolume?: number;
684
- bufferingTimeout?: number;
685
- spotifyBridge?: boolean;
686
- disableVolume?: boolean;
687
- onBeforeCreateStream?: (track: Track, source: TrackSource, queue: Queue) => Promise<Readable>;
688
- }
689
- /**
690
- * @typedef {object} ExtractorModelData
691
- * @property {object} [playlist] The playlist info (if any)
692
- * @property {string} [playlist.title] The playlist title
693
- * @property {string} [playlist.description] The playlist description
694
- * @property {string} [playlist.thumbnail] The playlist thumbnail
695
- * @property {album|playlist} [playlist.type] The playlist type: `album` | `playlist`
696
- * @property {TrackSource} [playlist.source] The playlist source
697
- * @property {object} [playlist.author] The playlist author
698
- * @property {string} [playlist.author.name] The author name
699
- * @property {string} [playlist.author.url] The author url
700
- * @property {string} [playlist.id] The playlist id
701
- * @property {string} [playlist.url] The playlist url
702
- * @property {any} [playlist.rawPlaylist] The raw data
703
- * @property {ExtractorData[]} data The data
704
- */
705
- /**
706
- * @typedef {object} ExtractorData
707
- * @property {string} title The title
708
- * @property {number} duration The duration
709
- * @property {string} thumbnail The thumbnail
710
- * @property {string|Readable|Duplex} engine The stream engine
711
- * @property {number} views The views count
712
- * @property {string} author The author
713
- * @property {string} description The description
714
- * @property {string} url The url
715
- * @property {string} [version] The extractor version
716
- * @property {TrackSource} [source="arbitrary"] The source
717
- */
718
- interface ExtractorModelData {
719
- playlist?: {
720
- title: string;
721
- description: string;
722
- thumbnail: string;
723
- type: "album" | "playlist";
724
- source: TrackSource;
725
- author: {
726
- name: string;
727
- url: string;
728
- };
729
- id: string;
730
- url: string;
731
- rawPlaylist?: any;
732
- };
733
- data: {
734
- title: string;
735
- duration: number;
736
- thumbnail: string;
737
- engine: string | Readable | Duplex;
738
- views: number;
739
- author: string;
740
- description: string;
741
- url: string;
742
- version?: string;
743
- source?: TrackSource;
744
- }[];
745
- }
746
- /**
747
- * The search query type
748
- * This can be one of:
749
- * - AUTO
750
- * - YOUTUBE
751
- * - YOUTUBE_PLAYLIST
752
- * - SOUNDCLOUD_TRACK
753
- * - SOUNDCLOUD_PLAYLIST
754
- * - SOUNDCLOUD
755
- * - SPOTIFY_SONG
756
- * - SPOTIFY_ALBUM
757
- * - SPOTIFY_PLAYLIST
758
- * - FACEBOOK
759
- * - VIMEO
760
- * - ARBITRARY
761
- * - REVERBNATION
762
- * - YOUTUBE_SEARCH
763
- * - YOUTUBE_VIDEO
764
- * - SOUNDCLOUD_SEARCH
765
- * @typedef {number} QueryType
766
- */
767
- declare enum QueryType {
768
- AUTO = 0,
769
- YOUTUBE = 1,
770
- YOUTUBE_PLAYLIST = 2,
771
- SOUNDCLOUD_TRACK = 3,
772
- SOUNDCLOUD_PLAYLIST = 4,
773
- SOUNDCLOUD = 5,
774
- SPOTIFY_SONG = 6,
775
- SPOTIFY_ALBUM = 7,
776
- SPOTIFY_PLAYLIST = 8,
777
- FACEBOOK = 9,
778
- VIMEO = 10,
779
- ARBITRARY = 11,
780
- REVERBNATION = 12,
781
- YOUTUBE_SEARCH = 13,
782
- YOUTUBE_VIDEO = 14,
783
- SOUNDCLOUD_SEARCH = 15
784
- }
785
- /**
786
- * Emitted when bot gets disconnected from a voice channel
787
- * @event Player#botDisconnect
788
- * @param {Queue} queue The queue
789
- */
790
- /**
791
- * Emitted when the voice channel is empty
792
- * @event Player#channelEmpty
793
- * @param {Queue} queue The queue
794
- */
795
- /**
796
- * Emitted when bot connects to a voice channel
797
- * @event Player#connectionCreate
798
- * @param {Queue} queue The queue
799
- * @param {StreamDispatcher} connection The discord player connection object
800
- */
801
- /**
802
- * Debug information
803
- * @event Player#debug
804
- * @param {Queue} queue The queue
805
- * @param {string} message The message
806
- */
807
- /**
808
- * Emitted on error
809
- * <warn>This event should handled properly otherwise it may crash your process!</warn>
810
- * @event Player#error
811
- * @param {Queue} queue The queue
812
- * @param {Error} error The error
813
- */
814
- /**
815
- * Emitted on connection error. Sometimes stream errors are emitted here as well.
816
- * @event Player#connectionError
817
- * @param {Queue} queue The queue
818
- * @param {Error} error The error
819
- */
820
- /**
821
- * Emitted when queue ends
822
- * @event Player#queueEnd
823
- * @param {Queue} queue The queue
824
- */
825
- /**
826
- * Emitted when a single track is added
827
- * @event Player#trackAdd
828
- * @param {Queue} queue The queue
829
- * @param {Track} track The track
830
- */
831
- /**
832
- * Emitted when multiple tracks are added
833
- * @event Player#tracksAdd
834
- * @param {Queue} queue The queue
835
- * @param {Track[]} tracks The tracks
836
- */
837
- /**
838
- * Emitted when a track starts playing
839
- * @event Player#trackStart
840
- * @param {Queue} queue The queue
841
- * @param {Track} track The track
842
- */
843
- /**
844
- * Emitted when a track ends
845
- * @event Player#trackEnd
846
- * @param {Queue} queue The queue
847
- * @param {Track} track The track
848
- */
849
- interface PlayerEvents {
850
- botDisconnect: (queue: Queue) => any;
851
- channelEmpty: (queue: Queue) => any;
852
- connectionCreate: (queue: Queue, connection: StreamDispatcher) => any;
853
- debug: (queue: Queue, message: string) => any;
854
- error: (queue: Queue, error: Error) => any;
855
- connectionError: (queue: Queue, error: Error) => any;
856
- queueEnd: (queue: Queue) => any;
857
- trackAdd: (queue: Queue, track: Track) => any;
858
- tracksAdd: (queue: Queue, track: Track[]) => any;
859
- trackStart: (queue: Queue, track: Track) => any;
860
- trackEnd: (queue: Queue, track: Track) => any;
861
- }
862
- /**
863
- * @typedef {object} PlayOptions
864
- * @property {boolean} [filtersUpdate=false] If this play was triggered for filters update
865
- * @property {string[]} [encoderArgs=[]] FFmpeg args passed to encoder
866
- * @property {number} [seek] Time to seek to before playing
867
- * @property {boolean} [immediate=false] If it should start playing the provided track immediately
868
- */
869
- interface PlayOptions {
870
- filtersUpdate?: boolean;
871
- encoderArgs?: string[];
872
- seek?: number;
873
- immediate?: boolean;
874
- }
875
- /**
876
- * @typedef {object} SearchOptions
877
- * @property {UserResolvable} requestedBy The user who requested this search
878
- * @property {QueryType|string} [searchEngine=QueryType.AUTO] The query search engine, can be extractor name to target specific one (custom)
879
- * @property {boolean} [blockExtractor=false] If it should block custom extractors
880
- */
881
- interface SearchOptions {
882
- requestedBy: UserResolvable;
883
- searchEngine?: QueryType | string;
884
- blockExtractor?: boolean;
885
- }
886
- /**
887
- * The queue repeat mode. This can be one of:
888
- * - OFF
889
- * - TRACK
890
- * - QUEUE
891
- * - AUTOPLAY
892
- * @typedef {number} QueueRepeatMode
893
- */
894
- declare enum QueueRepeatMode {
895
- OFF = 0,
896
- TRACK = 1,
897
- QUEUE = 2,
898
- AUTOPLAY = 3
899
- }
900
- /**
901
- * @typedef {object} PlaylistInitData
902
- * @property {Track[]} tracks The tracks of this playlist
903
- * @property {string} title The playlist title
904
- * @property {string} description The description
905
- * @property {string} thumbnail The thumbnail
906
- * @property {album|playlist} type The playlist type: `album` | `playlist`
907
- * @property {TrackSource} source The playlist source
908
- * @property {object} author The playlist author
909
- * @property {string} [author.name] The author name
910
- * @property {string} [author.url] The author url
911
- * @property {string} id The playlist id
912
- * @property {string} url The playlist url
913
- * @property {any} [rawPlaylist] The raw playlist data
914
- */
915
- interface PlaylistInitData {
916
- tracks: Track[];
917
- title: string;
918
- description: string;
919
- thumbnail: string;
920
- type: "album" | "playlist";
921
- source: TrackSource;
922
- author: {
923
- name: string;
924
- url: string;
925
- };
926
- id: string;
927
- url: string;
928
- rawPlaylist?: any;
929
- }
930
- /**
931
- * @typedef {object} TrackJSON
932
- * @property {string} title The track title
933
- * @property {string} description The track description
934
- * @property {string} author The author
935
- * @property {string} url The url
936
- * @property {string} thumbnail The thumbnail
937
- * @property {string} duration The duration
938
- * @property {number} durationMS The duration in ms
939
- * @property {number} views The views count
940
- * @property {Snowflake} requestedBy The id of the user who requested this track
941
- * @property {PlaylistJSON} [playlist] The playlist info (if any)
942
- */
943
- interface TrackJSON {
944
- id: Snowflake;
945
- title: string;
946
- description: string;
947
- author: string;
948
- url: string;
949
- thumbnail: string;
950
- duration: string;
951
- durationMS: number;
952
- views: number;
953
- requestedBy: Snowflake;
954
- playlist?: PlaylistJSON;
955
- }
956
- /**
957
- * @typedef {object} PlaylistJSON
958
- * @property {string} id The playlist id
959
- * @property {string} url The playlist url
960
- * @property {string} title The playlist title
961
- * @property {string} description The playlist description
962
- * @property {string} thumbnail The thumbnail
963
- * @property {album|playlist} type The playlist type: `album` | `playlist`
964
- * @property {TrackSource} source The track source
965
- * @property {object} author The playlist author
966
- * @property {string} [author.name] The author name
967
- * @property {string} [author.url] The author url
968
- * @property {TrackJSON[]} tracks The tracks data (if any)
969
- */
970
- interface PlaylistJSON {
971
- id: string;
972
- url: string;
973
- title: string;
974
- description: string;
975
- thumbnail: string;
976
- type: "album" | "playlist";
977
- source: TrackSource;
978
- author: {
979
- name: string;
980
- url: string;
981
- };
982
- tracks: TrackJSON[];
983
- }
984
- /**
985
- * @typedef {object} PlayerInitOptions
986
- * @property {boolean} [autoRegisterExtractor=true] If it should automatically register `@discord-player/extractor`
987
- * @property {YTDLDownloadOptions} [ytdlOptions={}] The options passed to `ytdl-core`
988
- * @property {number} [connectionTimeout=20000] The voice connection timeout
989
- */
990
- interface PlayerInitOptions {
991
- autoRegisterExtractor?: boolean;
992
- ytdlOptions?: downloadOptions;
993
- connectionTimeout?: number;
552
+ declare type FiltersName = keyof QueueFilters;
553
+ interface PlayerSearchResult {
554
+ playlist: Playlist | null;
555
+ tracks: Track[];
556
+ }
557
+ /**
558
+ * @typedef {AudioFilters} QueueFilters
559
+ */
560
+ interface QueueFilters {
561
+ bassboost_low?: boolean;
562
+ bassboost?: boolean;
563
+ bassboost_high?: boolean;
564
+ "8D"?: boolean;
565
+ vaporwave?: boolean;
566
+ nightcore?: boolean;
567
+ phaser?: boolean;
568
+ tremolo?: boolean;
569
+ vibrato?: boolean;
570
+ reverse?: boolean;
571
+ treble?: boolean;
572
+ normalizer?: boolean;
573
+ normalizer2?: boolean;
574
+ surrounding?: boolean;
575
+ pulsator?: boolean;
576
+ subboost?: boolean;
577
+ karaoke?: boolean;
578
+ flanger?: boolean;
579
+ gate?: boolean;
580
+ haas?: boolean;
581
+ mcompand?: boolean;
582
+ mono?: boolean;
583
+ mstlr?: boolean;
584
+ mstrr?: boolean;
585
+ compressor?: boolean;
586
+ expander?: boolean;
587
+ softlimiter?: boolean;
588
+ chorus?: boolean;
589
+ chorus2d?: boolean;
590
+ chorus3d?: boolean;
591
+ fadein?: boolean;
592
+ dim?: boolean;
593
+ earrape?: boolean;
594
+ }
595
+ /**
596
+ * The track source:
597
+ * - soundcloud
598
+ * - youtube
599
+ * - spotify
600
+ * - arbitrary
601
+ * @typedef {string} TrackSource
602
+ */
603
+ declare type TrackSource = "soundcloud" | "youtube" | "spotify" | "arbitrary";
604
+ /**
605
+ * @typedef {object} RawTrackData
606
+ * @property {string} title The title
607
+ * @property {string} description The description
608
+ * @property {string} author The author
609
+ * @property {string} url The url
610
+ * @property {string} thumbnail The thumbnail
611
+ * @property {string} duration The duration
612
+ * @property {number} views The views
613
+ * @property {User} requestedBy The user who requested this track
614
+ * @property {Playlist} [playlist] The playlist
615
+ * @property {TrackSource} [source="arbitrary"] The source
616
+ * @property {any} [engine] The engine
617
+ * @property {boolean} [live] If this track is live
618
+ * @property {any} [raw] The raw data
619
+ */
620
+ interface RawTrackData {
621
+ title: string;
622
+ description: string;
623
+ author: string;
624
+ url: string;
625
+ thumbnail: string;
626
+ duration: string;
627
+ views: number;
628
+ requestedBy: User;
629
+ playlist?: Playlist;
630
+ source?: TrackSource;
631
+ engine?: any;
632
+ live?: boolean;
633
+ raw?: any;
634
+ }
635
+ /**
636
+ * @typedef {object} TimeData
637
+ * @property {number} days Time in days
638
+ * @property {number} hours Time in hours
639
+ * @property {number} minutes Time in minutes
640
+ * @property {number} seconds Time in seconds
641
+ */
642
+ interface TimeData {
643
+ days: number;
644
+ hours: number;
645
+ minutes: number;
646
+ seconds: number;
647
+ }
648
+ /**
649
+ * @typedef {object} PlayerProgressbarOptions
650
+ * @property {boolean} [timecodes] If it should render time codes
651
+ * @property {boolean} [queue] If it should create progress bar for the whole queue
652
+ * @property {number} [length] The bar length
653
+ * @property {string} [line] The bar track
654
+ * @property {string} [indicator] The indicator
655
+ */
656
+ interface PlayerProgressbarOptions {
657
+ timecodes?: boolean;
658
+ length?: number;
659
+ line?: string;
660
+ indicator?: string;
661
+ }
662
+ /**
663
+ * @typedef {object} PlayerOptions
664
+ * @property {boolean} [leaveOnEnd=true] If it should leave on end
665
+ * @property {boolean} [leaveOnStop=true] If it should leave on stop
666
+ * @property {boolean} [leaveOnEmpty=true] If it should leave on empty
667
+ * @property {number} [leaveOnEmptyCooldown=1000] The cooldown in ms
668
+ * @property {boolean} [autoSelfDeaf=true] If it should set the bot in deaf mode
669
+ * @property {YTDLDownloadOptions} [ytdlOptions={}] The youtube download options
670
+ * @property {number} [initialVolume=100] The initial player volume
671
+ * @property {number} [bufferingTimeout=3000] Buffering timeout for the stream
672
+ * @property {boolean} [spotifyBridge=true] If player should bridge spotify source to youtube
673
+ * @property {boolean} [disableVolume=false] If player should disable inline volume
674
+ * @property {boolean} [volumeSmoothness=0] The volume transition smoothness between volume changes (lower the value to get better result)
675
+ * Setting this or leaving this empty will disable this effect. Example: `volumeSmoothness: 0.1`
676
+ * @property {Function} [onBeforeCreateStream] Runs before creating stream
677
+ */
678
+ interface PlayerOptions {
679
+ leaveOnEnd?: boolean;
680
+ leaveOnStop?: boolean;
681
+ leaveOnEmpty?: boolean;
682
+ leaveOnEmptyCooldown?: number;
683
+ autoSelfDeaf?: boolean;
684
+ ytdlOptions?: downloadOptions;
685
+ initialVolume?: number;
686
+ bufferingTimeout?: number;
687
+ spotifyBridge?: boolean;
688
+ disableVolume?: boolean;
689
+ volumeSmoothness?: number;
690
+ onBeforeCreateStream?: (track: Track, source: TrackSource, queue: Queue) => Promise<Readable>;
691
+ }
692
+ /**
693
+ * @typedef {object} ExtractorModelData
694
+ * @property {object} [playlist] The playlist info (if any)
695
+ * @property {string} [playlist.title] The playlist title
696
+ * @property {string} [playlist.description] The playlist description
697
+ * @property {string} [playlist.thumbnail] The playlist thumbnail
698
+ * @property {album|playlist} [playlist.type] The playlist type: `album` | `playlist`
699
+ * @property {TrackSource} [playlist.source] The playlist source
700
+ * @property {object} [playlist.author] The playlist author
701
+ * @property {string} [playlist.author.name] The author name
702
+ * @property {string} [playlist.author.url] The author url
703
+ * @property {string} [playlist.id] The playlist id
704
+ * @property {string} [playlist.url] The playlist url
705
+ * @property {any} [playlist.rawPlaylist] The raw data
706
+ * @property {ExtractorData[]} data The data
707
+ */
708
+ /**
709
+ * @typedef {object} ExtractorData
710
+ * @property {string} title The title
711
+ * @property {number} duration The duration
712
+ * @property {string} thumbnail The thumbnail
713
+ * @property {string|Readable|Duplex} engine The stream engine
714
+ * @property {number} views The views count
715
+ * @property {string} author The author
716
+ * @property {string} description The description
717
+ * @property {string} url The url
718
+ * @property {string} [version] The extractor version
719
+ * @property {TrackSource} [source="arbitrary"] The source
720
+ */
721
+ interface ExtractorModelData {
722
+ playlist?: {
723
+ title: string;
724
+ description: string;
725
+ thumbnail: string;
726
+ type: "album" | "playlist";
727
+ source: TrackSource;
728
+ author: {
729
+ name: string;
730
+ url: string;
731
+ };
732
+ id: string;
733
+ url: string;
734
+ rawPlaylist?: any;
735
+ };
736
+ data: {
737
+ title: string;
738
+ duration: number;
739
+ thumbnail: string;
740
+ engine: string | Readable | Duplex;
741
+ views: number;
742
+ author: string;
743
+ description: string;
744
+ url: string;
745
+ version?: string;
746
+ source?: TrackSource;
747
+ }[];
748
+ }
749
+ /**
750
+ * The search query type
751
+ * This can be one of:
752
+ * - AUTO
753
+ * - YOUTUBE
754
+ * - YOUTUBE_PLAYLIST
755
+ * - SOUNDCLOUD_TRACK
756
+ * - SOUNDCLOUD_PLAYLIST
757
+ * - SOUNDCLOUD
758
+ * - SPOTIFY_SONG
759
+ * - SPOTIFY_ALBUM
760
+ * - SPOTIFY_PLAYLIST
761
+ * - FACEBOOK
762
+ * - VIMEO
763
+ * - ARBITRARY
764
+ * - REVERBNATION
765
+ * - YOUTUBE_SEARCH
766
+ * - YOUTUBE_VIDEO
767
+ * - SOUNDCLOUD_SEARCH
768
+ * @typedef {number} QueryType
769
+ */
770
+ declare enum QueryType {
771
+ AUTO = 0,
772
+ YOUTUBE = 1,
773
+ YOUTUBE_PLAYLIST = 2,
774
+ SOUNDCLOUD_TRACK = 3,
775
+ SOUNDCLOUD_PLAYLIST = 4,
776
+ SOUNDCLOUD = 5,
777
+ SPOTIFY_SONG = 6,
778
+ SPOTIFY_ALBUM = 7,
779
+ SPOTIFY_PLAYLIST = 8,
780
+ FACEBOOK = 9,
781
+ VIMEO = 10,
782
+ ARBITRARY = 11,
783
+ REVERBNATION = 12,
784
+ YOUTUBE_SEARCH = 13,
785
+ YOUTUBE_VIDEO = 14,
786
+ SOUNDCLOUD_SEARCH = 15
787
+ }
788
+ /**
789
+ * Emitted when bot gets disconnected from a voice channel
790
+ * @event Player#botDisconnect
791
+ * @param {Queue} queue The queue
792
+ */
793
+ /**
794
+ * Emitted when the voice channel is empty
795
+ * @event Player#channelEmpty
796
+ * @param {Queue} queue The queue
797
+ */
798
+ /**
799
+ * Emitted when bot connects to a voice channel
800
+ * @event Player#connectionCreate
801
+ * @param {Queue} queue The queue
802
+ * @param {StreamDispatcher} connection The discord player connection object
803
+ */
804
+ /**
805
+ * Debug information
806
+ * @event Player#debug
807
+ * @param {Queue} queue The queue
808
+ * @param {string} message The message
809
+ */
810
+ /**
811
+ * Emitted on error
812
+ * <warn>This event should handled properly otherwise it may crash your process!</warn>
813
+ * @event Player#error
814
+ * @param {Queue} queue The queue
815
+ * @param {Error} error The error
816
+ */
817
+ /**
818
+ * Emitted on connection error. Sometimes stream errors are emitted here as well.
819
+ * @event Player#connectionError
820
+ * @param {Queue} queue The queue
821
+ * @param {Error} error The error
822
+ */
823
+ /**
824
+ * Emitted when queue ends
825
+ * @event Player#queueEnd
826
+ * @param {Queue} queue The queue
827
+ */
828
+ /**
829
+ * Emitted when a single track is added
830
+ * @event Player#trackAdd
831
+ * @param {Queue} queue The queue
832
+ * @param {Track} track The track
833
+ */
834
+ /**
835
+ * Emitted when multiple tracks are added
836
+ * @event Player#tracksAdd
837
+ * @param {Queue} queue The queue
838
+ * @param {Track[]} tracks The tracks
839
+ */
840
+ /**
841
+ * Emitted when a track starts playing
842
+ * @event Player#trackStart
843
+ * @param {Queue} queue The queue
844
+ * @param {Track} track The track
845
+ */
846
+ /**
847
+ * Emitted when a track ends
848
+ * @event Player#trackEnd
849
+ * @param {Queue} queue The queue
850
+ * @param {Track} track The track
851
+ */
852
+ interface PlayerEvents {
853
+ botDisconnect: (queue: Queue) => any;
854
+ channelEmpty: (queue: Queue) => any;
855
+ connectionCreate: (queue: Queue, connection: StreamDispatcher) => any;
856
+ debug: (queue: Queue, message: string) => any;
857
+ error: (queue: Queue, error: Error) => any;
858
+ connectionError: (queue: Queue, error: Error) => any;
859
+ queueEnd: (queue: Queue) => any;
860
+ trackAdd: (queue: Queue, track: Track) => any;
861
+ tracksAdd: (queue: Queue, track: Track[]) => any;
862
+ trackStart: (queue: Queue, track: Track) => any;
863
+ trackEnd: (queue: Queue, track: Track) => any;
864
+ }
865
+ /**
866
+ * @typedef {object} PlayOptions
867
+ * @property {boolean} [filtersUpdate=false] If this play was triggered for filters update
868
+ * @property {string[]} [encoderArgs=[]] FFmpeg args passed to encoder
869
+ * @property {number} [seek] Time to seek to before playing
870
+ * @property {boolean} [immediate=false] If it should start playing the provided track immediately
871
+ */
872
+ interface PlayOptions {
873
+ filtersUpdate?: boolean;
874
+ encoderArgs?: string[];
875
+ seek?: number;
876
+ immediate?: boolean;
877
+ }
878
+ /**
879
+ * @typedef {object} SearchOptions
880
+ * @property {UserResolvable} requestedBy The user who requested this search
881
+ * @property {QueryType|string} [searchEngine=QueryType.AUTO] The query search engine, can be extractor name to target specific one (custom)
882
+ * @property {boolean} [blockExtractor=false] If it should block custom extractors
883
+ */
884
+ interface SearchOptions {
885
+ requestedBy: UserResolvable;
886
+ searchEngine?: QueryType | string;
887
+ blockExtractor?: boolean;
888
+ }
889
+ /**
890
+ * The queue repeat mode. This can be one of:
891
+ * - OFF
892
+ * - TRACK
893
+ * - QUEUE
894
+ * - AUTOPLAY
895
+ * @typedef {number} QueueRepeatMode
896
+ */
897
+ declare enum QueueRepeatMode {
898
+ OFF = 0,
899
+ TRACK = 1,
900
+ QUEUE = 2,
901
+ AUTOPLAY = 3
902
+ }
903
+ /**
904
+ * @typedef {object} PlaylistInitData
905
+ * @property {Track[]} tracks The tracks of this playlist
906
+ * @property {string} title The playlist title
907
+ * @property {string} description The description
908
+ * @property {string} thumbnail The thumbnail
909
+ * @property {album|playlist} type The playlist type: `album` | `playlist`
910
+ * @property {TrackSource} source The playlist source
911
+ * @property {object} author The playlist author
912
+ * @property {string} [author.name] The author name
913
+ * @property {string} [author.url] The author url
914
+ * @property {string} id The playlist id
915
+ * @property {string} url The playlist url
916
+ * @property {any} [rawPlaylist] The raw playlist data
917
+ */
918
+ interface PlaylistInitData {
919
+ tracks: Track[];
920
+ title: string;
921
+ description: string;
922
+ thumbnail: string;
923
+ type: "album" | "playlist";
924
+ source: TrackSource;
925
+ author: {
926
+ name: string;
927
+ url: string;
928
+ };
929
+ id: string;
930
+ url: string;
931
+ rawPlaylist?: any;
932
+ }
933
+ /**
934
+ * @typedef {object} TrackJSON
935
+ * @property {string} title The track title
936
+ * @property {string} description The track description
937
+ * @property {string} author The author
938
+ * @property {string} url The url
939
+ * @property {string} thumbnail The thumbnail
940
+ * @property {string} duration The duration
941
+ * @property {number} durationMS The duration in ms
942
+ * @property {number} views The views count
943
+ * @property {Snowflake} requestedBy The id of the user who requested this track
944
+ * @property {PlaylistJSON} [playlist] The playlist info (if any)
945
+ */
946
+ interface TrackJSON {
947
+ id: Snowflake;
948
+ title: string;
949
+ description: string;
950
+ author: string;
951
+ url: string;
952
+ thumbnail: string;
953
+ duration: string;
954
+ durationMS: number;
955
+ views: number;
956
+ requestedBy: Snowflake;
957
+ playlist?: PlaylistJSON;
958
+ }
959
+ /**
960
+ * @typedef {object} PlaylistJSON
961
+ * @property {string} id The playlist id
962
+ * @property {string} url The playlist url
963
+ * @property {string} title The playlist title
964
+ * @property {string} description The playlist description
965
+ * @property {string} thumbnail The thumbnail
966
+ * @property {album|playlist} type The playlist type: `album` | `playlist`
967
+ * @property {TrackSource} source The track source
968
+ * @property {object} author The playlist author
969
+ * @property {string} [author.name] The author name
970
+ * @property {string} [author.url] The author url
971
+ * @property {TrackJSON[]} tracks The tracks data (if any)
972
+ */
973
+ interface PlaylistJSON {
974
+ id: string;
975
+ url: string;
976
+ title: string;
977
+ description: string;
978
+ thumbnail: string;
979
+ type: "album" | "playlist";
980
+ source: TrackSource;
981
+ author: {
982
+ name: string;
983
+ url: string;
984
+ };
985
+ tracks: TrackJSON[];
986
+ }
987
+ /**
988
+ * @typedef {object} PlayerInitOptions
989
+ * @property {boolean} [autoRegisterExtractor=true] If it should automatically register `@discord-player/extractor`
990
+ * @property {YTDLDownloadOptions} [ytdlOptions={}] The options passed to `ytdl-core`
991
+ * @property {number} [connectionTimeout=20000] The voice connection timeout
992
+ */
993
+ interface PlayerInitOptions {
994
+ autoRegisterExtractor?: boolean;
995
+ ytdlOptions?: downloadOptions;
996
+ connectionTimeout?: number;
994
997
  }
995
998
 
996
- /**
997
- * The available audio filters
998
- * @typedef {object} AudioFilters
999
- * @property {string} bassboost_low The bassboost filter (+15dB)
1000
- * @property {string} bassboost The bassboost filter (+20dB)
1001
- * @property {string} bassboost_high The bassboost filter (+30dB)
1002
- * @property {string} 8D The 8D filter
1003
- * @property {string} vaporwave The vaporwave filter
1004
- * @property {string} nightcore The nightcore filter
1005
- * @property {string} phaser The phaser filter
1006
- * @property {string} tremolo The tremolo filter
1007
- * @property {string} vibrato The vibrato filter
1008
- * @property {string} reverse The reverse filter
1009
- * @property {string} treble The treble filter
1010
- * @property {string} normalizer The normalizer filter (dynamic audio normalizer based)
1011
- * @property {string} normalizer2 The normalizer filter (audio compressor based)
1012
- * @property {string} surrounding The surrounding filter
1013
- * @property {string} pulsator The pulsator filter
1014
- * @property {string} subboost The subboost filter
1015
- * @property {string} karaoke The kakaoke filter
1016
- * @property {string} flanger The flanger filter
1017
- * @property {string} gate The gate filter
1018
- * @property {string} haas The haas filter
1019
- * @property {string} mcompand The mcompand filter
1020
- * @property {string} mono The mono filter
1021
- * @property {string} mstlr The mstlr filter
1022
- * @property {string} mstrr The mstrr filter
1023
- * @property {string} compressor The compressor filter
1024
- * @property {string} expander The expander filter
1025
- * @property {string} softlimiter The softlimiter filter
1026
- * @property {string} chorus The chorus filter
1027
- * @property {string} chorus2d The chorus2d filter
1028
- * @property {string} chorus3d The chorus3d filter
1029
- * @property {string} fadein The fadein filter
1030
- * @property {string} dim The dim filter
1031
- * @property {string} earrape The earrape filter
1032
- */
1033
- declare const FilterList: {
1034
- bassboost_low: string;
1035
- bassboost: string;
1036
- bassboost_high: string;
1037
- "8D": string;
1038
- vaporwave: string;
1039
- nightcore: string;
1040
- phaser: string;
1041
- tremolo: string;
1042
- vibrato: string;
1043
- reverse: string;
1044
- treble: string;
1045
- normalizer: string;
1046
- normalizer2: string;
1047
- surrounding: string;
1048
- pulsator: string;
1049
- subboost: string;
1050
- karaoke: string;
1051
- flanger: string;
1052
- gate: string;
1053
- haas: string;
1054
- mcompand: string;
1055
- mono: string;
1056
- mstlr: string;
1057
- mstrr: string;
1058
- compressor: string;
1059
- expander: string;
1060
- softlimiter: string;
1061
- chorus: string;
1062
- chorus2d: string;
1063
- chorus3d: string;
1064
- fadein: string;
1065
- dim: string;
1066
- earrape: string;
1067
- [Symbol.iterator](): IterableIterator<{
1068
- name: FiltersName;
1069
- value: string;
1070
- }>;
1071
- readonly names: (keyof QueueFilters)[];
1072
- readonly length: number;
1073
- toString(): string;
1074
- create(filter?: FiltersName[]): string;
1075
- define(filterName: string, value: string): void;
1076
- defineBulk(filterArray: {
1077
- name: string;
1078
- value: string;
1079
- }[]): void;
999
+ /**
1000
+ * The available audio filters
1001
+ * @typedef {object} AudioFilters
1002
+ * @property {string} bassboost_low The bassboost filter (+15dB)
1003
+ * @property {string} bassboost The bassboost filter (+20dB)
1004
+ * @property {string} bassboost_high The bassboost filter (+30dB)
1005
+ * @property {string} 8D The 8D filter
1006
+ * @property {string} vaporwave The vaporwave filter
1007
+ * @property {string} nightcore The nightcore filter
1008
+ * @property {string} phaser The phaser filter
1009
+ * @property {string} tremolo The tremolo filter
1010
+ * @property {string} vibrato The vibrato filter
1011
+ * @property {string} reverse The reverse filter
1012
+ * @property {string} treble The treble filter
1013
+ * @property {string} normalizer The normalizer filter (dynamic audio normalizer based)
1014
+ * @property {string} normalizer2 The normalizer filter (audio compressor based)
1015
+ * @property {string} surrounding The surrounding filter
1016
+ * @property {string} pulsator The pulsator filter
1017
+ * @property {string} subboost The subboost filter
1018
+ * @property {string} karaoke The kakaoke filter
1019
+ * @property {string} flanger The flanger filter
1020
+ * @property {string} gate The gate filter
1021
+ * @property {string} haas The haas filter
1022
+ * @property {string} mcompand The mcompand filter
1023
+ * @property {string} mono The mono filter
1024
+ * @property {string} mstlr The mstlr filter
1025
+ * @property {string} mstrr The mstrr filter
1026
+ * @property {string} compressor The compressor filter
1027
+ * @property {string} expander The expander filter
1028
+ * @property {string} softlimiter The softlimiter filter
1029
+ * @property {string} chorus The chorus filter
1030
+ * @property {string} chorus2d The chorus2d filter
1031
+ * @property {string} chorus3d The chorus3d filter
1032
+ * @property {string} fadein The fadein filter
1033
+ * @property {string} dim The dim filter
1034
+ * @property {string} earrape The earrape filter
1035
+ */
1036
+ declare const FilterList: {
1037
+ bassboost_low: string;
1038
+ bassboost: string;
1039
+ bassboost_high: string;
1040
+ "8D": string;
1041
+ vaporwave: string;
1042
+ nightcore: string;
1043
+ phaser: string;
1044
+ tremolo: string;
1045
+ vibrato: string;
1046
+ reverse: string;
1047
+ treble: string;
1048
+ normalizer: string;
1049
+ normalizer2: string;
1050
+ surrounding: string;
1051
+ pulsator: string;
1052
+ subboost: string;
1053
+ karaoke: string;
1054
+ flanger: string;
1055
+ gate: string;
1056
+ haas: string;
1057
+ mcompand: string;
1058
+ mono: string;
1059
+ mstlr: string;
1060
+ mstrr: string;
1061
+ compressor: string;
1062
+ expander: string;
1063
+ softlimiter: string;
1064
+ chorus: string;
1065
+ chorus2d: string;
1066
+ chorus3d: string;
1067
+ fadein: string;
1068
+ dim: string;
1069
+ earrape: string;
1070
+ [Symbol.iterator](): IterableIterator<{
1071
+ name: FiltersName;
1072
+ value: string;
1073
+ }>;
1074
+ readonly names: (keyof QueueFilters)[];
1075
+ readonly length: number;
1076
+ toString(): string;
1077
+ create(filter?: FiltersName[]): string;
1078
+ define(filterName: string, value: string): void;
1079
+ defineBulk(filterArray: {
1080
+ name: string;
1081
+ value: string;
1082
+ }[]): void;
1080
1083
  };
1081
1084
 
1082
- declare enum ErrorStatusCode {
1083
- STREAM_ERROR = "StreamError",
1084
- AUDIO_PLAYER_ERROR = "AudioPlayerError",
1085
- PLAYER_ERROR = "PlayerError",
1086
- NO_AUDIO_RESOURCE = "NoAudioResource",
1087
- UNKNOWN_GUILD = "UnknownGuild",
1088
- INVALID_ARG_TYPE = "InvalidArgType",
1089
- UNKNOWN_EXTRACTOR = "UnknownExtractor",
1090
- INVALID_EXTRACTOR = "InvalidExtractor",
1091
- INVALID_CHANNEL_TYPE = "InvalidChannelType",
1092
- INVALID_TRACK = "InvalidTrack",
1093
- UNKNOWN_REPEAT_MODE = "UnknownRepeatMode",
1094
- TRACK_NOT_FOUND = "TrackNotFound",
1095
- NO_CONNECTION = "NoConnection",
1096
- DESTROYED_QUEUE = "DestroyedQueue"
1097
- }
1098
- declare class PlayerError extends Error {
1099
- message: string;
1100
- statusCode: ErrorStatusCode;
1101
- createdAt: Date;
1102
- constructor(message: string, code?: ErrorStatusCode);
1103
- get createdTimestamp(): number;
1104
- valueOf(): ErrorStatusCode;
1105
- toJSON(): {
1106
- stack: string;
1107
- code: ErrorStatusCode;
1108
- message: string;
1109
- created: number;
1110
- };
1111
- toString(): string;
1085
+ declare enum ErrorStatusCode {
1086
+ STREAM_ERROR = "StreamError",
1087
+ AUDIO_PLAYER_ERROR = "AudioPlayerError",
1088
+ PLAYER_ERROR = "PlayerError",
1089
+ NO_AUDIO_RESOURCE = "NoAudioResource",
1090
+ UNKNOWN_GUILD = "UnknownGuild",
1091
+ INVALID_ARG_TYPE = "InvalidArgType",
1092
+ UNKNOWN_EXTRACTOR = "UnknownExtractor",
1093
+ INVALID_EXTRACTOR = "InvalidExtractor",
1094
+ INVALID_CHANNEL_TYPE = "InvalidChannelType",
1095
+ INVALID_TRACK = "InvalidTrack",
1096
+ UNKNOWN_REPEAT_MODE = "UnknownRepeatMode",
1097
+ TRACK_NOT_FOUND = "TrackNotFound",
1098
+ NO_CONNECTION = "NoConnection",
1099
+ DESTROYED_QUEUE = "DestroyedQueue"
1100
+ }
1101
+ declare class PlayerError extends Error {
1102
+ message: string;
1103
+ statusCode: ErrorStatusCode;
1104
+ createdAt: Date;
1105
+ constructor(message: string, code?: ErrorStatusCode);
1106
+ get createdTimestamp(): number;
1107
+ valueOf(): ErrorStatusCode;
1108
+ toJSON(): {
1109
+ stack: string;
1110
+ code: ErrorStatusCode;
1111
+ message: string;
1112
+ created: number;
1113
+ };
1114
+ toString(): string;
1112
1115
  }
1113
1116
 
1114
- declare class QueryResolver {
1115
- /**
1116
- * Query resolver
1117
- */
1118
- private constructor();
1119
- /**
1120
- * Resolves the given search query
1121
- * @param {string} query The query
1122
- * @returns {QueryType}
1123
- */
1124
- static resolve(query: string): QueryType;
1125
- /**
1126
- * Parses vimeo id from url
1127
- * @param {string} query The query
1128
- * @returns {string}
1129
- */
1130
- static getVimeoID(query: string): string;
1117
+ declare class QueryResolver {
1118
+ /**
1119
+ * Query resolver
1120
+ */
1121
+ private constructor();
1122
+ /**
1123
+ * Resolves the given search query
1124
+ * @param {string} query The query
1125
+ * @returns {QueryType}
1126
+ */
1127
+ static resolve(query: string): QueryType;
1128
+ /**
1129
+ * Parses vimeo id from url
1130
+ * @param {string} query The query
1131
+ * @returns {string}
1132
+ */
1133
+ static getVimeoID(query: string): string;
1131
1134
  }
1132
1135
 
1133
- declare class Util {
1134
- /**
1135
- * Utils
1136
- */
1137
- private constructor();
1138
- /**
1139
- * Creates duration string
1140
- * @param {object} durObj The duration object
1141
- * @returns {string}
1142
- */
1143
- static durationString(durObj: Record<string, number>): string;
1144
- /**
1145
- * Parses milliseconds to consumable time object
1146
- * @param {number} milliseconds The time in ms
1147
- * @returns {TimeData}
1148
- */
1149
- static parseMS(milliseconds: number): TimeData;
1150
- /**
1151
- * Builds time code
1152
- * @param {TimeData} duration The duration object
1153
- * @returns {string}
1154
- */
1155
- static buildTimeCode(duration: TimeData): string;
1156
- /**
1157
- * Picks last item of the given array
1158
- * @param {any[]} arr The array
1159
- * @returns {any}
1160
- */
1161
- static last<T = any>(arr: T[]): T;
1162
- /**
1163
- * Checks if the voice channel is empty
1164
- * @param {VoiceChannel|StageChannel} channel The voice channel
1165
- * @returns {boolean}
1166
- */
1167
- static isVoiceEmpty(channel: VoiceChannel | StageChannel): boolean;
1168
- /**
1169
- * Safer require
1170
- * @param {string} id Node require id
1171
- * @returns {any}
1172
- */
1173
- static require(id: string): any;
1174
- /**
1175
- * Asynchronous timeout
1176
- * @param {number} time The time in ms to wait
1177
- * @returns {Promise<unknown>}
1178
- */
1179
- static wait(time: number): Promise<unknown>;
1180
- static noop(): void;
1136
+ declare class Util {
1137
+ /**
1138
+ * Utils
1139
+ */
1140
+ private constructor();
1141
+ /**
1142
+ * Creates duration string
1143
+ * @param {object} durObj The duration object
1144
+ * @returns {string}
1145
+ */
1146
+ static durationString(durObj: Record<string, number>): string;
1147
+ /**
1148
+ * Parses milliseconds to consumable time object
1149
+ * @param {number} milliseconds The time in ms
1150
+ * @returns {TimeData}
1151
+ */
1152
+ static parseMS(milliseconds: number): TimeData;
1153
+ /**
1154
+ * Builds time code
1155
+ * @param {TimeData} duration The duration object
1156
+ * @returns {string}
1157
+ */
1158
+ static buildTimeCode(duration: TimeData): string;
1159
+ /**
1160
+ * Picks last item of the given array
1161
+ * @param {any[]} arr The array
1162
+ * @returns {any}
1163
+ */
1164
+ static last<T = any>(arr: T[]): T;
1165
+ /**
1166
+ * Checks if the voice channel is empty
1167
+ * @param {VoiceChannel|StageChannel} channel The voice channel
1168
+ * @returns {boolean}
1169
+ */
1170
+ static isVoiceEmpty(channel: VoiceChannel | StageChannel): boolean;
1171
+ /**
1172
+ * Safer require
1173
+ * @param {string} id Node require id
1174
+ * @returns {any}
1175
+ */
1176
+ static require(id: string): any;
1177
+ /**
1178
+ * Asynchronous timeout
1179
+ * @param {number} time The time in ms to wait
1180
+ * @returns {Promise<unknown>}
1181
+ */
1182
+ static wait(time: number): Promise<unknown>;
1183
+ static noop(): void;
1181
1184
  }
1182
1185
 
1183
1186
  declare const version: string;