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/README.md +35 -18
- package/dist/index.d.ts +2524 -2466
- package/dist/index.js +1361 -117
- package/dist/index.mjs +4 -0
- package/package.json +7 -5
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
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
*
|
|
880
|
-
* @param
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
*
|
|
886
|
-
* @param
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
*
|
|
892
|
-
* @param
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
*
|
|
898
|
-
* @param
|
|
899
|
-
*/
|
|
900
|
-
|
|
901
|
-
/**
|
|
902
|
-
* Emitted when a connection is
|
|
903
|
-
* @param queue The queue where this event occurred
|
|
904
|
-
*/
|
|
905
|
-
|
|
906
|
-
/**
|
|
907
|
-
* Emitted when
|
|
908
|
-
* @param queue The queue where this event occurred
|
|
909
|
-
*/
|
|
910
|
-
|
|
911
|
-
/**
|
|
912
|
-
* Emitted when the
|
|
913
|
-
* @param queue The queue where this event occurred
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
*
|
|
919
|
-
* @param
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
*
|
|
925
|
-
* @param
|
|
926
|
-
*/
|
|
927
|
-
|
|
928
|
-
/**
|
|
929
|
-
* Emitted when the
|
|
930
|
-
* @param queue The queue where this event occurred
|
|
931
|
-
*/
|
|
932
|
-
|
|
933
|
-
/**
|
|
934
|
-
* Emitted when the
|
|
935
|
-
* @param queue The queue where this event occurred
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
*
|
|
941
|
-
* @param
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
*
|
|
948
|
-
* @param
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
*
|
|
954
|
-
* @param
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
*
|
|
960
|
-
* @param
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
*
|
|
966
|
-
* @param
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
*
|
|
973
|
-
* @param
|
|
974
|
-
*/
|
|
975
|
-
|
|
976
|
-
/**
|
|
977
|
-
* Emitted when audio player is
|
|
978
|
-
* @param queue The queue where this event occurred
|
|
979
|
-
*/
|
|
980
|
-
|
|
981
|
-
/**
|
|
982
|
-
* Emitted when audio player
|
|
983
|
-
* @param queue The queue where this event occurred
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
*
|
|
990
|
-
* @param
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
*
|
|
997
|
-
* @param
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
*
|
|
1004
|
-
* @param
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
*
|
|
1011
|
-
* @param
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
*
|
|
1018
|
-
*
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
*
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
*
|
|
1027
|
-
* @param
|
|
1028
|
-
*/
|
|
1029
|
-
|
|
1030
|
-
/**
|
|
1031
|
-
* Emitted when a
|
|
1032
|
-
* @param queue The queue where this event occurred
|
|
1033
|
-
*/
|
|
1034
|
-
|
|
1035
|
-
/**
|
|
1036
|
-
* Emitted when a queue is successfully
|
|
1037
|
-
* @param queue The queue where this event occurred
|
|
1038
|
-
*/
|
|
1039
|
-
|
|
1040
|
-
/**
|
|
1041
|
-
* Emitted when a queue is
|
|
1042
|
-
* @param queue The queue where this event occurred
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
*
|
|
1080
|
-
*/
|
|
1081
|
-
|
|
1082
|
-
/**
|
|
1083
|
-
*
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
/**
|
|
1088
|
-
*
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
/**
|
|
1093
|
-
*
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
/**
|
|
1106
|
-
* The voice
|
|
1107
|
-
*/
|
|
1108
|
-
get
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
*
|
|
1120
|
-
*/
|
|
1121
|
-
|
|
1122
|
-
/**
|
|
1123
|
-
*
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
*
|
|
1129
|
-
*/
|
|
1130
|
-
|
|
1131
|
-
/**
|
|
1132
|
-
*
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
*
|
|
1158
|
-
*/
|
|
1159
|
-
|
|
1160
|
-
/**
|
|
1161
|
-
* Set max size for this queue
|
|
1162
|
-
* @param size The size to set
|
|
1163
|
-
*/
|
|
1164
|
-
|
|
1165
|
-
/**
|
|
1166
|
-
*
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
*
|
|
1188
|
-
*/
|
|
1189
|
-
|
|
1190
|
-
/**
|
|
1191
|
-
*
|
|
1192
|
-
* @param track
|
|
1193
|
-
*/
|
|
1194
|
-
|
|
1195
|
-
/**
|
|
1196
|
-
*
|
|
1197
|
-
* @param track The track to
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
*
|
|
1203
|
-
* @param
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
*
|
|
1209
|
-
* @param
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
*
|
|
1215
|
-
* @param
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
*
|
|
1221
|
-
* @param
|
|
1222
|
-
*/
|
|
1223
|
-
|
|
1224
|
-
/**
|
|
1225
|
-
*
|
|
1226
|
-
* @param
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
* The voice
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
*
|
|
1241
|
-
*/
|
|
1242
|
-
|
|
1243
|
-
/**
|
|
1244
|
-
*
|
|
1245
|
-
* @
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
*
|
|
1251
|
-
* @param
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
*
|
|
1257
|
-
* @param
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
*
|
|
1263
|
-
* @param
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
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
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
interface
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
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
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
}
|
|
1582
|
-
declare class
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
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
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
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
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
/**
|
|
1688
|
-
*
|
|
1689
|
-
*/
|
|
1690
|
-
|
|
1691
|
-
/**
|
|
1692
|
-
*
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
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
|
-
|
|
1757
|
-
*
|
|
1758
|
-
* @param {
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
*
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
*
|
|
1771
|
-
* @param
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
*
|
|
1777
|
-
* @param
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
*
|
|
1799
|
-
*
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
*
|
|
1805
|
-
*
|
|
1806
|
-
*
|
|
1807
|
-
*
|
|
1808
|
-
*
|
|
1809
|
-
*
|
|
1810
|
-
* //
|
|
1811
|
-
* //
|
|
1812
|
-
* //
|
|
1813
|
-
* //
|
|
1814
|
-
* //
|
|
1815
|
-
* //
|
|
1816
|
-
* // GuildQueueStatisticsMetadata,
|
|
1817
|
-
* // GuildQueueStatisticsMetadata,
|
|
1818
|
-
* //
|
|
1819
|
-
* //
|
|
1820
|
-
* //
|
|
1821
|
-
*
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
*
|
|
1832
|
-
*
|
|
1833
|
-
*
|
|
1834
|
-
*
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
*
|
|
1841
|
-
* @param {VoiceState}
|
|
1842
|
-
* @
|
|
1843
|
-
* @
|
|
1844
|
-
*
|
|
1845
|
-
*
|
|
1846
|
-
*
|
|
1847
|
-
*
|
|
1848
|
-
*
|
|
1849
|
-
*
|
|
1850
|
-
*
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
*
|
|
1868
|
-
* @param
|
|
1869
|
-
* @param
|
|
1870
|
-
* @
|
|
1871
|
-
*
|
|
1872
|
-
*
|
|
1873
|
-
*
|
|
1874
|
-
*
|
|
1875
|
-
*
|
|
1876
|
-
*
|
|
1877
|
-
* }
|
|
1878
|
-
*
|
|
1879
|
-
* }
|
|
1880
|
-
*
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
*
|
|
1886
|
-
* @param {
|
|
1887
|
-
* @
|
|
1888
|
-
* @
|
|
1889
|
-
*
|
|
1890
|
-
* const
|
|
1891
|
-
*
|
|
1892
|
-
*
|
|
1893
|
-
*
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
*
|
|
1899
|
-
*
|
|
1900
|
-
*
|
|
1901
|
-
*
|
|
1902
|
-
*
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
*
|
|
1909
|
-
|
|
1910
|
-
|
|
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
|
|
1916
|
-
equalizer?: EqualizerBand[]
|
|
1917
|
-
a_filter?: PCMFilters[]
|
|
1918
|
-
biquad?: BiquadFilters
|
|
1919
|
-
resampler?: number
|
|
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
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
*
|
|
1955
|
-
* @param
|
|
1956
|
-
*/
|
|
1957
|
-
|
|
1958
|
-
/**
|
|
1959
|
-
*
|
|
1960
|
-
* @param node Queue resolvable
|
|
1961
|
-
*/
|
|
1962
|
-
|
|
1963
|
-
/**
|
|
1964
|
-
*
|
|
1965
|
-
* @param node Queue resolvable
|
|
1966
|
-
*/
|
|
1967
|
-
|
|
1968
|
-
/**
|
|
1969
|
-
*
|
|
1970
|
-
* @param node Queue resolvable
|
|
1971
|
-
*/
|
|
1972
|
-
|
|
1973
|
-
/**
|
|
1974
|
-
* Resolve queue
|
|
1975
|
-
* @param node Queue resolvable
|
|
1976
|
-
*/
|
|
1977
|
-
|
|
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
|
-
|
|
2026
|
-
*
|
|
2027
|
-
* -
|
|
2028
|
-
* -
|
|
2029
|
-
* -
|
|
2030
|
-
* -
|
|
2031
|
-
*
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
* @
|
|
2037
|
-
* @property {string}
|
|
2038
|
-
* @property {string}
|
|
2039
|
-
* @property {string}
|
|
2040
|
-
* @property {string}
|
|
2041
|
-
* @property {string}
|
|
2042
|
-
* @property {
|
|
2043
|
-
* @property {
|
|
2044
|
-
* @property {
|
|
2045
|
-
* @property {
|
|
2046
|
-
* @property {
|
|
2047
|
-
* @property {
|
|
2048
|
-
* @property {
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
* @
|
|
2069
|
-
* @property {number}
|
|
2070
|
-
* @property {number}
|
|
2071
|
-
* @property {number}
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
* @
|
|
2082
|
-
* @property {boolean} [
|
|
2083
|
-
* @property {
|
|
2084
|
-
* @property {
|
|
2085
|
-
* @property {string} [
|
|
2086
|
-
* @property {string} [
|
|
2087
|
-
* @property {string} [
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
*
|
|
2101
|
-
*
|
|
2102
|
-
* -
|
|
2103
|
-
* -
|
|
2104
|
-
* -
|
|
2105
|
-
* -
|
|
2106
|
-
* -
|
|
2107
|
-
* -
|
|
2108
|
-
* -
|
|
2109
|
-
* -
|
|
2110
|
-
* -
|
|
2111
|
-
* -
|
|
2112
|
-
* -
|
|
2113
|
-
* -
|
|
2114
|
-
* -
|
|
2115
|
-
* -
|
|
2116
|
-
* -
|
|
2117
|
-
* -
|
|
2118
|
-
* -
|
|
2119
|
-
* -
|
|
2120
|
-
* -
|
|
2121
|
-
* -
|
|
2122
|
-
* -
|
|
2123
|
-
* -
|
|
2124
|
-
*
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
readonly
|
|
2129
|
-
readonly
|
|
2130
|
-
readonly
|
|
2131
|
-
readonly
|
|
2132
|
-
readonly
|
|
2133
|
-
readonly
|
|
2134
|
-
readonly
|
|
2135
|
-
readonly
|
|
2136
|
-
readonly
|
|
2137
|
-
readonly
|
|
2138
|
-
readonly
|
|
2139
|
-
readonly
|
|
2140
|
-
readonly
|
|
2141
|
-
readonly
|
|
2142
|
-
readonly
|
|
2143
|
-
readonly
|
|
2144
|
-
readonly
|
|
2145
|
-
readonly
|
|
2146
|
-
readonly
|
|
2147
|
-
readonly
|
|
2148
|
-
readonly
|
|
2149
|
-
readonly
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
* @
|
|
2165
|
-
* @property {
|
|
2166
|
-
* @property {
|
|
2167
|
-
* @property {
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
* @
|
|
2179
|
-
* @property {
|
|
2180
|
-
* @property {string
|
|
2181
|
-
* @property {
|
|
2182
|
-
* @property {
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
*
|
|
2196
|
-
* -
|
|
2197
|
-
*
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
* @
|
|
2210
|
-
* @property {
|
|
2211
|
-
* @property {
|
|
2212
|
-
* @property {
|
|
2213
|
-
* @property {
|
|
2214
|
-
* @property {
|
|
2215
|
-
* @property {
|
|
2216
|
-
* @property {
|
|
2217
|
-
* @property {string}
|
|
2218
|
-
* @property {
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
* @
|
|
2240
|
-
* @property {string}
|
|
2241
|
-
* @property {string}
|
|
2242
|
-
* @property {string}
|
|
2243
|
-
* @property {
|
|
2244
|
-
* @property {
|
|
2245
|
-
* @property {
|
|
2246
|
-
* @property {
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
* @
|
|
2266
|
-
* @property {string}
|
|
2267
|
-
* @property {string}
|
|
2268
|
-
* @property {
|
|
2269
|
-
* @property {
|
|
2270
|
-
* @property {
|
|
2271
|
-
* @property {
|
|
2272
|
-
* @property {
|
|
2273
|
-
* @property {
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
* @
|
|
2294
|
-
* @property {
|
|
2295
|
-
* @property {
|
|
2296
|
-
* @property {
|
|
2297
|
-
* @property {
|
|
2298
|
-
* @property {
|
|
2299
|
-
* @property {
|
|
2300
|
-
* @property {
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
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 };
|