aqualink 2.11.0 → 2.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +594 -263
- package/build/structures/Aqua.js +333 -279
- package/build/structures/Node.js +211 -132
- package/build/structures/Player.js +422 -291
- package/build/structures/Rest.js +78 -73
- package/package.json +8 -6
package/build/index.d.ts
CHANGED
|
@@ -1,56 +1,46 @@
|
|
|
1
1
|
import { EventEmitter } from "events";
|
|
2
2
|
|
|
3
3
|
declare module "aqualink" {
|
|
4
|
+
// Main Classes
|
|
4
5
|
export class Aqua extends EventEmitter {
|
|
5
6
|
constructor(client: any, nodes: NodeOptions[], options?: AquaOptions);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
nodeMap: Map<string, Node>;
|
|
9
|
-
players: Map<string, Player>;
|
|
10
|
-
clientId: string | null;
|
|
11
|
-
initiated: boolean;
|
|
12
|
-
shouldDeleteMessage: boolean;
|
|
13
|
-
defaultSearchPlatform: string;
|
|
14
|
-
leaveOnEnd: boolean;
|
|
15
|
-
restVersion: string;
|
|
7
|
+
|
|
8
|
+
// Additional properties found in implementation
|
|
16
9
|
plugins: Plugin[];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
players: Map<string, Player>;
|
|
11
|
+
nodeMap: Map<string, Node>;
|
|
12
|
+
_nodeStates: Map<string, { connected: boolean; failoverInProgress: boolean }>;
|
|
13
|
+
_failoverQueue: Map<string, number>;
|
|
14
|
+
_lastFailoverAttempt: Map<string, number>;
|
|
15
|
+
_brokenPlayers: Map<string, any>;
|
|
16
|
+
_rebuildLocks: Set<string>;
|
|
17
|
+
_leastUsedNodesCache: Node[] | null;
|
|
18
|
+
_leastUsedNodesCacheTime: number;
|
|
19
|
+
_nodeLoadCache: Map<string, number>;
|
|
20
|
+
_nodeLoadCacheTime: Map<string, number>;
|
|
21
|
+
|
|
24
22
|
|
|
25
|
-
defaultSendFunction(payload: any): void;
|
|
26
|
-
get leastUsedNodes(): Node[];
|
|
27
23
|
init(clientId: string): Promise<Aqua>;
|
|
28
24
|
createNode(options: NodeOptions): Promise<Node>;
|
|
29
25
|
destroyNode(identifier: string): void;
|
|
30
|
-
updateVoiceState(
|
|
26
|
+
updateVoiceState(data: VoiceStateUpdate): void;
|
|
31
27
|
fetchRegion(region: string): Node[];
|
|
32
|
-
calculateLoad(node: Node): number;
|
|
33
28
|
createConnection(options: ConnectionOptions): Player;
|
|
34
29
|
createPlayer(node: Node, options: PlayerOptions): Player;
|
|
35
30
|
destroyPlayer(guildId: string): Promise<void>;
|
|
36
|
-
resolve(
|
|
37
|
-
getRequestNode(nodes: string | Node): Node;
|
|
38
|
-
ensureInitialized(): void;
|
|
39
|
-
formatQuery(query: string, source: string): string;
|
|
40
|
-
handleNoMatches(rest: Rest, query: string): Promise<any>;
|
|
41
|
-
constructResponse(response: any, requester: any, requestNode: Node): ResolveResponse;
|
|
31
|
+
resolve(options: ResolveOptions): Promise<ResolveResponse>;
|
|
42
32
|
get(guildId: string): Player;
|
|
43
33
|
search(query: string, requester: any, source?: SearchSource): Promise<Track[] | null>;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
getHealthyNodes(): Node[];
|
|
49
|
-
isNodeHealthy(node: Node): boolean;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
// Missing public methods
|
|
37
|
+
bypassChecks?: { nodeFetchInfo?: boolean };
|
|
50
38
|
}
|
|
51
39
|
|
|
52
40
|
export class Node {
|
|
53
41
|
constructor(aqua: Aqua, connOptions: NodeOptions, options?: NodeAdditionalOptions);
|
|
42
|
+
|
|
43
|
+
// Core Properties
|
|
54
44
|
aqua: Aqua;
|
|
55
45
|
host: string;
|
|
56
46
|
name: string;
|
|
@@ -67,26 +57,32 @@ declare module "aqualink" {
|
|
|
67
57
|
reconnectTries: number;
|
|
68
58
|
infiniteReconnects: boolean;
|
|
69
59
|
connected: boolean;
|
|
70
|
-
info:
|
|
71
|
-
ws:
|
|
60
|
+
info: NodeInfo | null;
|
|
61
|
+
ws: any | null; // WebSocket
|
|
72
62
|
reconnectAttempted: number;
|
|
73
63
|
reconnectTimeoutId: NodeJS.Timeout | null;
|
|
64
|
+
isDestroyed: boolean;
|
|
74
65
|
stats: NodeStats;
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
players: Set<Player>;
|
|
67
|
+
options: NodeOptions;
|
|
77
68
|
|
|
78
|
-
|
|
69
|
+
// Methods
|
|
79
70
|
connect(): Promise<void>;
|
|
80
71
|
destroy(clean?: boolean): void;
|
|
81
72
|
getStats(): Promise<NodeStats>;
|
|
82
|
-
isHealthy(): boolean;
|
|
83
|
-
markFailure(): void;
|
|
84
|
-
markSuccess(): void;
|
|
85
|
-
getHealth(): NodeHealth;
|
|
86
73
|
}
|
|
87
74
|
|
|
88
75
|
export class Player extends EventEmitter {
|
|
89
76
|
constructor(aqua: Aqua, nodes: Node, options: PlayerOptions);
|
|
77
|
+
|
|
78
|
+
// Static Properties
|
|
79
|
+
static readonly LOOP_MODES: {
|
|
80
|
+
readonly NONE: 0;
|
|
81
|
+
readonly TRACK: 1;
|
|
82
|
+
readonly QUEUE: 2;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// Core Properties
|
|
90
86
|
aqua: Aqua;
|
|
91
87
|
nodes: Node;
|
|
92
88
|
guildId: string;
|
|
@@ -95,16 +91,14 @@ declare module "aqualink" {
|
|
|
95
91
|
connection: Connection;
|
|
96
92
|
filters: Filters;
|
|
97
93
|
volume: number;
|
|
98
|
-
loop: LoopMode;
|
|
94
|
+
loop: LoopModeName | LoopMode;
|
|
99
95
|
queue: Queue;
|
|
100
|
-
previousTracks: Track[];
|
|
101
|
-
previousTracksIndex: number;
|
|
102
|
-
previousTracksCount: number;
|
|
103
96
|
shouldDeleteMessage: boolean;
|
|
104
97
|
leaveOnEnd: boolean;
|
|
105
98
|
playing: boolean;
|
|
106
99
|
paused: boolean;
|
|
107
100
|
connected: boolean;
|
|
101
|
+
destroyed: boolean;
|
|
108
102
|
current: Track | null;
|
|
109
103
|
position: number;
|
|
110
104
|
timestamp: number;
|
|
@@ -112,17 +106,26 @@ declare module "aqualink" {
|
|
|
112
106
|
nowPlayingMessage: any;
|
|
113
107
|
isAutoplayEnabled: boolean;
|
|
114
108
|
isAutoplay: boolean;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
109
|
+
autoplaySeed: AutoplaySeed | null;
|
|
110
|
+
deaf: boolean;
|
|
111
|
+
mute: boolean;
|
|
112
|
+
autoplayRetries: number;
|
|
113
|
+
reconnectionRetries: number;
|
|
114
|
+
previousIdentifiers: Set<string>;
|
|
115
|
+
|
|
116
|
+
// Getters
|
|
117
|
+
get previous(): Track | null;
|
|
118
|
+
get currenttrack(): Track | null;
|
|
119
|
+
|
|
120
|
+
// Core Methods
|
|
121
|
+
play(): Promise<Player>;
|
|
122
|
+
connect(options?: ConnectionOptions): Player;
|
|
123
|
+
destroy(options?: { preserveClient?: boolean; skipRemote?: boolean }): Player;
|
|
121
124
|
pause(paused: boolean): Player;
|
|
122
125
|
seek(position: number): Player;
|
|
123
126
|
stop(): Player;
|
|
124
127
|
setVolume(volume: number): Player;
|
|
125
|
-
setLoop(mode: LoopMode): Player;
|
|
128
|
+
setLoop(mode: LoopMode | LoopModeName): Player;
|
|
126
129
|
setTextChannel(channel: string): Player;
|
|
127
130
|
setVoiceChannel(channel: string): Player;
|
|
128
131
|
disconnect(): Player;
|
|
@@ -130,136 +133,161 @@ declare module "aqualink" {
|
|
|
130
133
|
getQueue(): Queue;
|
|
131
134
|
replay(): Player;
|
|
132
135
|
skip(): Player;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
|
|
137
|
+
// Advanced Methods
|
|
138
|
+
getLyrics(options?: LyricsOptions): Promise<LyricsResponse | null>;
|
|
139
|
+
subscribeLiveLyrics(): Promise<any>;
|
|
140
|
+
unsubscribeLiveLyrics(): Promise<any>;
|
|
141
|
+
autoplay(): Promise<Player>;
|
|
142
|
+
setAutoplay(enabled: boolean): Player;
|
|
143
|
+
updatePlayer(data: any): Promise<any>;
|
|
144
|
+
cleanup(): Promise<void>;
|
|
145
|
+
|
|
146
|
+
// Data Methods
|
|
147
|
+
set(key: string, value: any): void;
|
|
148
|
+
get(key: string): any;
|
|
149
|
+
clearData(): Player;
|
|
150
|
+
|
|
151
|
+
// Utility Methods
|
|
152
|
+
send(data: any): void;
|
|
153
|
+
batchUpdatePlayer(data: any, immediate?: boolean): Promise<void>;
|
|
138
154
|
}
|
|
139
155
|
|
|
140
156
|
export class Track {
|
|
141
|
-
constructor(data
|
|
142
|
-
|
|
157
|
+
constructor(data?: TrackData, requester?: any, nodes?: Node);
|
|
158
|
+
|
|
159
|
+
// Properties
|
|
160
|
+
identifier: string;
|
|
161
|
+
isSeekable: boolean;
|
|
162
|
+
author: string;
|
|
163
|
+
position: number;
|
|
164
|
+
duration: number;
|
|
165
|
+
isStream: boolean;
|
|
166
|
+
title: string;
|
|
167
|
+
uri: string;
|
|
168
|
+
sourceName: string;
|
|
169
|
+
artworkUrl: string;
|
|
143
170
|
track: string | null;
|
|
144
|
-
playlist:
|
|
171
|
+
playlist: PlaylistInfo | null;
|
|
145
172
|
requester: any;
|
|
146
173
|
nodes: Node;
|
|
147
174
|
|
|
148
|
-
|
|
175
|
+
// Getters
|
|
176
|
+
get info(): TrackInfo;
|
|
177
|
+
get length(): number;
|
|
178
|
+
get thumbnail(): string;
|
|
179
|
+
|
|
180
|
+
// Methods
|
|
181
|
+
resolveThumbnail(url?: string): string | null;
|
|
149
182
|
resolve(aqua: Aqua): Promise<Track | null>;
|
|
183
|
+
isValid(): boolean;
|
|
184
|
+
dispose(): void;
|
|
150
185
|
}
|
|
151
186
|
|
|
152
187
|
export class Rest {
|
|
153
|
-
constructor(aqua: Aqua,
|
|
188
|
+
constructor(aqua: Aqua, node: Node);
|
|
189
|
+
|
|
154
190
|
aqua: Aqua;
|
|
191
|
+
node: Node;
|
|
155
192
|
sessionId: string;
|
|
156
|
-
|
|
157
|
-
baseUrl: string;
|
|
158
|
-
headers: any;
|
|
159
|
-
secure: boolean;
|
|
160
|
-
timeout: number;
|
|
161
|
-
client: any;
|
|
193
|
+
calls: number;
|
|
162
194
|
|
|
163
195
|
setSessionId(sessionId: string): void;
|
|
164
|
-
makeRequest(method:
|
|
165
|
-
updatePlayer(options:
|
|
166
|
-
getPlayers(): Promise<any>;
|
|
196
|
+
makeRequest(method: HttpMethod, endpoint: string, body?: any): Promise<any>;
|
|
197
|
+
updatePlayer(options: UpdatePlayerOptions): Promise<any>;
|
|
167
198
|
destroyPlayer(guildId: string): Promise<any>;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
getStats(): Promise<
|
|
172
|
-
getInfo(): Promise<any>;
|
|
173
|
-
getRoutePlannerStatus(): Promise<any>;
|
|
174
|
-
getRoutePlannerAddress(address: string): Promise<any>;
|
|
175
|
-
getLyrics(options: { track: Track }): Promise<any>;
|
|
176
|
-
getSearchSuggestions(query: string, source?: SearchSource): Promise<SearchSuggestion[]>;
|
|
177
|
-
getAutocompleteSuggestions(query: string, source?: SearchSource): Promise<AutocompleteResult>;
|
|
199
|
+
getLyrics(options: GetLyricsOptions): Promise<LyricsResponse>;
|
|
200
|
+
subscribeLiveLyrics(guildId: string, sync?: boolean): Promise<any>;
|
|
201
|
+
unsubscribeLiveLyrics(guildId: string): Promise<any>;
|
|
202
|
+
getStats(): Promise<NodeStats>;
|
|
178
203
|
}
|
|
179
204
|
|
|
180
|
-
export class Queue extends Array<
|
|
181
|
-
constructor(...elements:
|
|
182
|
-
size: number;
|
|
183
|
-
first: any;
|
|
184
|
-
last: any;
|
|
205
|
+
export class Queue extends Array<Track> {
|
|
206
|
+
constructor(...elements: Track[]);
|
|
185
207
|
|
|
186
|
-
|
|
187
|
-
|
|
208
|
+
// Properties
|
|
209
|
+
size: number;
|
|
210
|
+
first: Track | null;
|
|
211
|
+
last: Track | null;
|
|
212
|
+
|
|
213
|
+
// Methods
|
|
214
|
+
add(...tracks: Track[]): void;
|
|
215
|
+
push(track: Track): number;
|
|
216
|
+
unshift(track: Track): number;
|
|
217
|
+
shift(): Track | undefined;
|
|
188
218
|
clear(): void;
|
|
189
|
-
shuffle(): void;
|
|
190
|
-
peek(): any;
|
|
191
|
-
toArray(): any[];
|
|
192
|
-
at(index: number): any;
|
|
193
|
-
dequeue(): any;
|
|
194
219
|
isEmpty(): boolean;
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export class Plugin {
|
|
199
|
-
constructor(name: string);
|
|
200
|
-
name: string;
|
|
201
|
-
|
|
202
|
-
load(aqua: Aqua): void;
|
|
203
|
-
unload(aqua: Aqua): void;
|
|
220
|
+
toArray(): Track[];
|
|
204
221
|
}
|
|
205
222
|
|
|
206
223
|
export class Filters {
|
|
207
224
|
constructor(player: Player, options?: FilterOptions);
|
|
225
|
+
|
|
208
226
|
player: Player;
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
227
|
+
filters: {
|
|
228
|
+
volume: number;
|
|
229
|
+
equalizer: EqualizerBand[];
|
|
230
|
+
karaoke: KaraokeSettings | null;
|
|
231
|
+
timescale: TimescaleSettings | null;
|
|
232
|
+
tremolo: TremoloSettings | null;
|
|
233
|
+
vibrato: VibratoSettings | null;
|
|
234
|
+
rotation: RotationSettings | null;
|
|
235
|
+
distortion: DistortionSettings | null;
|
|
236
|
+
channelMix: ChannelMixSettings | null;
|
|
237
|
+
lowPass: LowPassSettings | null;
|
|
238
|
+
};
|
|
239
|
+
presets: {
|
|
240
|
+
bassboost: number | null;
|
|
241
|
+
slowmode: boolean | null;
|
|
242
|
+
nightcore: boolean | null;
|
|
243
|
+
vaporwave: boolean | null;
|
|
244
|
+
_8d: boolean | null;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
// Filter Methods
|
|
248
|
+
setEqualizer(bands: EqualizerBand[]): Filters;
|
|
249
|
+
setKaraoke(enabled: boolean, options?: KaraokeSettings): Filters;
|
|
250
|
+
setTimescale(options?: TimescaleSettings): Filters;
|
|
251
|
+
setTremolo(options?: TremoloSettings): Filters;
|
|
252
|
+
setVibrato(options?: VibratoSettings): Filters;
|
|
253
|
+
setRotation( options?: RotationSettings): Filters;
|
|
254
|
+
setDistortion( options?: DistortionSettings): Filters;
|
|
255
|
+
setChannelMix(options?: ChannelMixSettings): Filters;
|
|
256
|
+
setLowPass( options?: LowPassSettings): Filters;
|
|
257
|
+
setBassboost(enabled: boolean, options?: { value?: number }): Filters;
|
|
258
|
+
setSlowmode(enabled: boolean, options?: { rate?: number }): Filters;
|
|
259
|
+
setNightcore(enabled: boolean, options?: { rate?: number }): Filters;
|
|
260
|
+
setVaporwave(enabled: boolean, options?: { pitch?: number }): Filters;
|
|
261
|
+
set8D(enabled: boolean, options?: { rotationHz?: number }): Filters;
|
|
239
262
|
clearFilters(): Promise<Filters>;
|
|
240
263
|
updateFilters(): Promise<Filters>;
|
|
241
264
|
}
|
|
242
265
|
|
|
243
266
|
export class Connection {
|
|
244
267
|
constructor(player: Player);
|
|
245
|
-
|
|
268
|
+
|
|
269
|
+
voiceChannel: string;
|
|
246
270
|
sessionId: string | null;
|
|
247
271
|
endpoint: string | null;
|
|
248
272
|
token: string | null;
|
|
249
273
|
region: string | null;
|
|
250
|
-
|
|
251
|
-
selfMute: boolean;
|
|
252
|
-
voiceChannel: string;
|
|
253
|
-
guildId: string;
|
|
254
|
-
aqua: Aqua;
|
|
255
|
-
nodes: Node;
|
|
274
|
+
sequence: number;
|
|
256
275
|
|
|
257
|
-
setServerUpdate(data:
|
|
258
|
-
setStateUpdate(data:
|
|
276
|
+
setServerUpdate(data: VoiceServerUpdate['d']): void;
|
|
277
|
+
setStateUpdate(data: VoiceStateUpdate['d']): void;
|
|
278
|
+
updateSequence(seq: number): void;
|
|
279
|
+
destroy(): void;
|
|
259
280
|
}
|
|
260
281
|
|
|
261
|
-
|
|
262
|
-
|
|
282
|
+
export class Plugin {
|
|
283
|
+
constructor(name: string);
|
|
284
|
+
name: string;
|
|
285
|
+
load(aqua: Aqua): void | Promise<void>;
|
|
286
|
+
unload?(aqua: Aqua): void | Promise<void>;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Configuration Interfaces
|
|
290
|
+
export interface AquaOptions {
|
|
263
291
|
shouldDeleteMessage?: boolean;
|
|
264
292
|
defaultSearchPlatform?: SearchSource;
|
|
265
293
|
leaveOnEnd?: boolean;
|
|
@@ -271,7 +299,7 @@ declare module "aqualink" {
|
|
|
271
299
|
failoverOptions?: FailoverOptions;
|
|
272
300
|
}
|
|
273
301
|
|
|
274
|
-
interface FailoverOptions {
|
|
302
|
+
export interface FailoverOptions {
|
|
275
303
|
enabled?: boolean;
|
|
276
304
|
maxRetries?: number;
|
|
277
305
|
retryDelay?: number;
|
|
@@ -279,12 +307,9 @@ declare module "aqualink" {
|
|
|
279
307
|
resumePlayback?: boolean;
|
|
280
308
|
cooldownTime?: number;
|
|
281
309
|
maxFailoverAttempts?: number;
|
|
282
|
-
healthCheckInterval?: number;
|
|
283
|
-
unhealthyThreshold?: number;
|
|
284
|
-
recoveryCooldown?: number;
|
|
285
310
|
}
|
|
286
311
|
|
|
287
|
-
interface NodeOptions {
|
|
312
|
+
export interface NodeOptions {
|
|
288
313
|
host: string;
|
|
289
314
|
name?: string;
|
|
290
315
|
port?: number;
|
|
@@ -292,63 +317,56 @@ declare module "aqualink" {
|
|
|
292
317
|
secure?: boolean;
|
|
293
318
|
sessionId?: string;
|
|
294
319
|
regions?: string[];
|
|
295
|
-
priority?: number;
|
|
296
|
-
retryAmount?: number;
|
|
297
|
-
retryDelay?: number;
|
|
298
320
|
}
|
|
299
321
|
|
|
300
|
-
interface NodeAdditionalOptions {
|
|
322
|
+
export interface NodeAdditionalOptions {
|
|
301
323
|
resumeTimeout?: number;
|
|
302
324
|
autoResume?: boolean;
|
|
303
325
|
reconnectTimeout?: number;
|
|
304
326
|
reconnectTries?: number;
|
|
305
327
|
infiniteReconnects?: boolean;
|
|
328
|
+
timeout?: number;
|
|
329
|
+
maxPayload?: number;
|
|
330
|
+
skipUTF8Validation?: boolean;
|
|
306
331
|
}
|
|
307
332
|
|
|
308
|
-
interface PlayerOptions {
|
|
333
|
+
export interface PlayerOptions {
|
|
309
334
|
guildId: string;
|
|
310
335
|
textChannel: string;
|
|
311
336
|
voiceChannel: string;
|
|
312
337
|
defaultVolume?: number;
|
|
313
|
-
loop?:
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
autoplay?: boolean;
|
|
317
|
-
enableFailover?: boolean;
|
|
338
|
+
loop?: LoopModeName;
|
|
339
|
+
deaf?: boolean;
|
|
340
|
+
mute?: boolean;
|
|
318
341
|
}
|
|
319
342
|
|
|
320
|
-
interface ConnectionOptions {
|
|
343
|
+
export interface ConnectionOptions {
|
|
321
344
|
guildId: string;
|
|
322
345
|
voiceChannel: string;
|
|
346
|
+
textChannel?: string;
|
|
323
347
|
deaf?: boolean;
|
|
324
348
|
mute?: boolean;
|
|
349
|
+
defaultVolume?: number;
|
|
350
|
+
region?: string;
|
|
325
351
|
}
|
|
326
352
|
|
|
327
|
-
interface ResolveOptions {
|
|
353
|
+
export interface ResolveOptions {
|
|
328
354
|
query: string;
|
|
329
|
-
source?: SearchSource;
|
|
355
|
+
source?: SearchSource | string;
|
|
330
356
|
requester: any;
|
|
331
|
-
nodes?: string | Node;
|
|
357
|
+
nodes?: string | Node | Node[];
|
|
332
358
|
}
|
|
333
359
|
|
|
334
|
-
|
|
360
|
+
// Response and Data Interfaces
|
|
361
|
+
export interface ResolveResponse {
|
|
335
362
|
loadType: LoadType;
|
|
336
363
|
exception: LavalinkException | null;
|
|
337
364
|
playlistInfo: PlaylistInfo | null;
|
|
338
|
-
pluginInfo: any
|
|
365
|
+
pluginInfo: Record<string, any>;
|
|
339
366
|
tracks: Track[];
|
|
340
367
|
}
|
|
341
368
|
|
|
342
|
-
interface
|
|
343
|
-
secure: boolean;
|
|
344
|
-
host: string;
|
|
345
|
-
port: number;
|
|
346
|
-
sessionId: string;
|
|
347
|
-
password: string;
|
|
348
|
-
timeout?: number;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
interface NodeStats {
|
|
369
|
+
export interface NodeStats {
|
|
352
370
|
players: number;
|
|
353
371
|
playingPlayers: number;
|
|
354
372
|
uptime: number;
|
|
@@ -357,24 +375,44 @@ declare module "aqualink" {
|
|
|
357
375
|
used: number;
|
|
358
376
|
allocated: number;
|
|
359
377
|
reservable: number;
|
|
360
|
-
freePercentage: number;
|
|
361
|
-
usedPercentage: number;
|
|
362
378
|
};
|
|
363
379
|
cpu: {
|
|
364
380
|
cores: number;
|
|
365
381
|
systemLoad: number;
|
|
366
382
|
lavalinkLoad: number;
|
|
367
|
-
lavalinkLoadPercentage: number;
|
|
368
383
|
};
|
|
369
384
|
frameStats: {
|
|
370
385
|
sent: number;
|
|
371
386
|
nulled: number;
|
|
372
387
|
deficit: number;
|
|
373
388
|
};
|
|
374
|
-
ping
|
|
389
|
+
ping?: number;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export interface NodeInfo {
|
|
393
|
+
version: {
|
|
394
|
+
semver: string;
|
|
395
|
+
major: number;
|
|
396
|
+
minor: number;
|
|
397
|
+
patch: number;
|
|
398
|
+
};
|
|
399
|
+
buildTime: number;
|
|
400
|
+
git: {
|
|
401
|
+
branch: string;
|
|
402
|
+
commit: string;
|
|
403
|
+
commitTime: number;
|
|
404
|
+
};
|
|
405
|
+
jvm: string;
|
|
406
|
+
lavaplayer: string;
|
|
407
|
+
sourceManagers: string[];
|
|
408
|
+
filters: string[];
|
|
409
|
+
plugins: Array<{
|
|
410
|
+
name: string;
|
|
411
|
+
version: string;
|
|
412
|
+
}>;
|
|
375
413
|
}
|
|
376
414
|
|
|
377
|
-
interface TrackInfo {
|
|
415
|
+
export interface TrackInfo {
|
|
378
416
|
identifier: string;
|
|
379
417
|
isSeekable: boolean;
|
|
380
418
|
author: string;
|
|
@@ -387,60 +425,171 @@ declare module "aqualink" {
|
|
|
387
425
|
position?: number;
|
|
388
426
|
}
|
|
389
427
|
|
|
390
|
-
interface
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
timescale?: any;
|
|
395
|
-
tremolo?: any;
|
|
396
|
-
vibrato?: any;
|
|
397
|
-
rotation?: any;
|
|
398
|
-
distortion?: any;
|
|
399
|
-
channelMix?: any;
|
|
400
|
-
lowPass?: any;
|
|
401
|
-
bassboost?: any;
|
|
402
|
-
slowmode?: any;
|
|
403
|
-
nightcore?: any;
|
|
404
|
-
vaporwave?: any;
|
|
405
|
-
_8d?: any;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
interface SearchSuggestion {
|
|
409
|
-
text: string;
|
|
410
|
-
highlighted: string;
|
|
411
|
-
type: SuggestionType;
|
|
412
|
-
source: SearchSource;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
interface AutocompleteResult {
|
|
416
|
-
query: string;
|
|
417
|
-
suggestions: SearchSuggestion[];
|
|
418
|
-
hasMore: boolean;
|
|
419
|
-
timestamp: number;
|
|
428
|
+
export interface TrackData {
|
|
429
|
+
encoded?: string;
|
|
430
|
+
info: TrackInfo;
|
|
431
|
+
playlist?: PlaylistInfo;
|
|
420
432
|
}
|
|
421
433
|
|
|
422
|
-
interface PlaylistInfo {
|
|
434
|
+
export interface PlaylistInfo {
|
|
423
435
|
name: string;
|
|
424
|
-
selectedTrack
|
|
436
|
+
selectedTrack?: number;
|
|
437
|
+
thumbnail?: string;
|
|
425
438
|
}
|
|
426
439
|
|
|
427
|
-
interface LavalinkException {
|
|
440
|
+
export interface LavalinkException {
|
|
428
441
|
message: string;
|
|
429
|
-
severity:
|
|
442
|
+
severity: string;
|
|
430
443
|
cause: string;
|
|
431
444
|
}
|
|
432
445
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
446
|
+
// Filter Interfaces
|
|
447
|
+
export interface FilterOptions {
|
|
448
|
+
volume?: number;
|
|
449
|
+
equalizer?: EqualizerBand[];
|
|
450
|
+
karaoke?: KaraokeSettings;
|
|
451
|
+
timescale?: TimescaleSettings;
|
|
452
|
+
tremolo?: TremoloSettings;
|
|
453
|
+
vibrato?: VibratoSettings;
|
|
454
|
+
rotation?: RotationSettings;
|
|
455
|
+
distortion?: DistortionSettings;
|
|
456
|
+
channelMix?: ChannelMixSettings;
|
|
457
|
+
lowPass?: LowPassSettings;
|
|
458
|
+
bassboost?: number;
|
|
459
|
+
slowmode?: boolean;
|
|
460
|
+
nightcore?: boolean;
|
|
461
|
+
vaporwave?: boolean;
|
|
462
|
+
_8d?: boolean;
|
|
439
463
|
}
|
|
440
464
|
|
|
441
|
-
|
|
465
|
+
export interface EqualizerBand {
|
|
466
|
+
band: number;
|
|
467
|
+
gain: number;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
export interface KaraokeSettings {
|
|
471
|
+
level?: number;
|
|
472
|
+
monoLevel?: number;
|
|
473
|
+
filterBand?: number;
|
|
474
|
+
filterWidth?: number;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export interface TimescaleSettings {
|
|
478
|
+
speed?: number;
|
|
479
|
+
pitch?: number;
|
|
480
|
+
rate?: number;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export interface TremoloSettings {
|
|
484
|
+
frequency?: number;
|
|
485
|
+
depth?: number;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export interface VibratoSettings {
|
|
489
|
+
frequency?: number;
|
|
490
|
+
depth?: number;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
export interface RotationSettings {
|
|
494
|
+
rotationHz?: number;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export interface DistortionSettings {
|
|
498
|
+
distortion?: number;
|
|
499
|
+
sinOffset?: number;
|
|
500
|
+
sinScale?: number;
|
|
501
|
+
cosOffset?: number;
|
|
502
|
+
cosScale?: number;
|
|
503
|
+
tanOffset?: number;
|
|
504
|
+
tanScale?: number;
|
|
505
|
+
offset?: number;
|
|
506
|
+
scale?: number;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
export interface ChannelMixSettings {
|
|
510
|
+
leftToLeft?: number;
|
|
511
|
+
leftToRight?: number;
|
|
512
|
+
rightToLeft?: number;
|
|
513
|
+
rightToRight?: number;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
export interface LowPassSettings {
|
|
517
|
+
smoothing?: number;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// Voice Update Interfaces
|
|
521
|
+
export interface VoiceStateUpdate {
|
|
522
|
+
d: {
|
|
523
|
+
guild_id: string;
|
|
524
|
+
channel_id: string | null;
|
|
525
|
+
user_id: string;
|
|
526
|
+
session_id: string;
|
|
527
|
+
deaf: boolean;
|
|
528
|
+
mute: boolean;
|
|
529
|
+
self_deaf: boolean;
|
|
530
|
+
self_mute: boolean;
|
|
531
|
+
suppress: boolean;
|
|
532
|
+
request_to_speak_timestamp: string | null;
|
|
533
|
+
};
|
|
534
|
+
t: 'VOICE_STATE_UPDATE';
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export interface VoiceServerUpdate {
|
|
538
|
+
d: {
|
|
539
|
+
token: string;
|
|
540
|
+
guild_id: string;
|
|
541
|
+
endpoint: string | null;
|
|
542
|
+
};
|
|
543
|
+
t: 'VOICE_SERVER_UPDATE';
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// Utility Interfaces
|
|
547
|
+
export interface LyricsOptions {
|
|
548
|
+
query?: string;
|
|
549
|
+
useCurrentTrack?: boolean;
|
|
550
|
+
skipTrackSource?: boolean;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
export interface LyricsResponse {
|
|
554
|
+
text?: string;
|
|
555
|
+
source?: string;
|
|
556
|
+
lines?: Array<{
|
|
557
|
+
line: string;
|
|
558
|
+
timestamp?: number;
|
|
559
|
+
}>;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export interface AutoplaySeed {
|
|
563
|
+
trackId: string;
|
|
564
|
+
artistIds: string;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
export interface UpdatePlayerOptions {
|
|
568
|
+
guildId: string;
|
|
569
|
+
data: {
|
|
570
|
+
track?: { encoded: string | null };
|
|
571
|
+
position?: number;
|
|
572
|
+
volume?: number;
|
|
573
|
+
paused?: boolean;
|
|
574
|
+
filters?: any;
|
|
575
|
+
voice?: any;
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
export interface GetLyricsOptions {
|
|
580
|
+
track: {
|
|
581
|
+
info: TrackInfo;
|
|
582
|
+
encoded?: string;
|
|
583
|
+
identifier?: string;
|
|
584
|
+
guild_id?: string;
|
|
585
|
+
};
|
|
586
|
+
skipTrackSource?: boolean;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
// Type Unions and Enums
|
|
590
|
+
export type SearchSource =
|
|
442
591
|
| 'ytsearch'
|
|
443
|
-
| 'ytmsearch'
|
|
592
|
+
| 'ytmsearch'
|
|
444
593
|
| 'scsearch'
|
|
445
594
|
| 'spsearch'
|
|
446
595
|
| 'amsearch'
|
|
@@ -456,72 +605,254 @@ declare module "aqualink" {
|
|
|
456
605
|
| 'twitch'
|
|
457
606
|
| 'http';
|
|
458
607
|
|
|
459
|
-
type LoopMode =
|
|
608
|
+
export type LoopMode = 0 | 1 | 2;
|
|
609
|
+
export type LoopModeName = 'none' | 'track' | 'queue';
|
|
460
610
|
|
|
461
|
-
type LoadType =
|
|
611
|
+
export type LoadType =
|
|
462
612
|
| 'track'
|
|
463
|
-
| 'playlist'
|
|
613
|
+
| 'playlist'
|
|
464
614
|
| 'search'
|
|
465
615
|
| 'empty'
|
|
466
616
|
| 'error';
|
|
467
617
|
|
|
468
|
-
type RestVersion = 'v3' | 'v4';
|
|
469
|
-
|
|
470
|
-
type SuggestionType =
|
|
471
|
-
| 'track'
|
|
472
|
-
| 'artist'
|
|
473
|
-
| 'album'
|
|
474
|
-
| 'playlist'
|
|
475
|
-
| 'query';
|
|
618
|
+
export type RestVersion = 'v3' | 'v4';
|
|
476
619
|
|
|
477
|
-
type
|
|
478
|
-
| 'common'
|
|
479
|
-
| 'suspicious'
|
|
480
|
-
| 'fault';
|
|
620
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
481
621
|
|
|
482
|
-
|
|
622
|
+
// Event Interfaces
|
|
623
|
+
export interface AquaEvents {
|
|
483
624
|
'nodeConnect': (node: Node) => void;
|
|
484
|
-
'
|
|
625
|
+
'nodeConnected': (node: Node) => void;
|
|
626
|
+
'nodeDisconnect': (node: Node, data: { code: number; reason: string }) => void;
|
|
485
627
|
'nodeError': (node: Node, error: Error) => void;
|
|
486
|
-
'nodeReconnect': (node: Node) => void;
|
|
628
|
+
'nodeReconnect': (node: Node, data: any) => void;
|
|
629
|
+
'nodeCreate': (node: Node) => void;
|
|
630
|
+
'nodeDestroy': (node: Node) => void;
|
|
631
|
+
'nodeReady': (node: Node, data: any) => void;
|
|
632
|
+
'nodeFailover': (node: Node) => void;
|
|
633
|
+
'nodeFailoverComplete': (node: Node, successful: number, failed: number) => void;
|
|
487
634
|
'playerCreate': (player: Player) => void;
|
|
488
635
|
'playerDestroy': (player: Player) => void;
|
|
636
|
+
'playerUpdate': (player: Player, packet: any) => void;
|
|
637
|
+
'playerMigrated': (oldPlayer: Player, newPlayer: Player, targetNode: Node) => void;
|
|
638
|
+
'playerReconnected': (player: Player, data: any) => void;
|
|
489
639
|
'trackStart': (player: Player, track: Track) => void;
|
|
490
|
-
'trackEnd': (player: Player, track: Track) => void;
|
|
491
|
-
'trackError': (player: Player, track: Track, error:
|
|
640
|
+
'trackEnd': (player: Player, track: Track, reason?: string) => void;
|
|
641
|
+
'trackError': (player: Player, track: Track, error: any) => void;
|
|
492
642
|
'trackStuck': (player: Player, track: Track, thresholdMs: number) => void;
|
|
643
|
+
'trackChange': (player: Player, track: Track, payload: any) => void;
|
|
493
644
|
'queueEnd': (player: Player) => void;
|
|
494
|
-
'playerMove': (
|
|
495
|
-
'
|
|
496
|
-
'
|
|
497
|
-
'
|
|
645
|
+
'playerMove': (oldChannel: string, newChannel: string) => void;
|
|
646
|
+
'playersRebuilt': (node: Node, count: number) => void;
|
|
647
|
+
'reconnectionFailed': (player: Player, data: any) => void;
|
|
648
|
+
'socketClosed': (player: Player, payload: any) => void;
|
|
649
|
+
'lyricsLine': (player: Player, track: Track, payload: any) => void;
|
|
650
|
+
'lyricsFound': (player: Player, track: Track, payload: any) => void;
|
|
651
|
+
'lyricsNotFound': (player: Player, track: Track, payload: any) => void;
|
|
652
|
+
'autoplayFailed': (player: Player, error: Error) => void;
|
|
653
|
+
'debug': (source: string, message: string) => void;
|
|
654
|
+
'error': (node: Node | null, error: Error) => void;
|
|
498
655
|
}
|
|
499
656
|
|
|
500
|
-
|
|
501
|
-
'trackStart': (track: Track) => void;
|
|
502
|
-
'trackEnd': (track: Track) => void;
|
|
503
|
-
'trackError': (track: Track, error: Error) => void;
|
|
504
|
-
'trackStuck': (track: Track, thresholdMs: number) => void;
|
|
505
|
-
'playerUpdate': (state: any) => void;
|
|
506
|
-
'queueEnd': () => void;
|
|
507
|
-
'socketClosed': (code: number, reason: string, byRemote: boolean) => void;
|
|
508
|
-
'failover': (oldNode: Node, newNode: Node) => void;
|
|
509
|
-
'failoverFailed': (error: Error) => void;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
export const DEFAULT_OPTIONS: Required<AquaOptions>;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
declare module "aqualink" {
|
|
657
|
+
// Event Emitter Type Extensions for Aqua
|
|
516
658
|
interface Aqua {
|
|
517
659
|
on<K extends keyof AquaEvents>(event: K, listener: AquaEvents[K]): this;
|
|
660
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
661
|
+
|
|
518
662
|
once<K extends keyof AquaEvents>(event: K, listener: AquaEvents[K]): this;
|
|
663
|
+
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
664
|
+
|
|
519
665
|
emit<K extends keyof AquaEvents>(event: K, ...args: Parameters<AquaEvents[K]>): boolean;
|
|
666
|
+
emit(event: string | symbol, ...args: any[]): boolean;
|
|
667
|
+
|
|
668
|
+
off<K extends keyof AquaEvents>(event: K, listener: AquaEvents[K]): this;
|
|
669
|
+
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
670
|
+
|
|
671
|
+
removeListener<K extends keyof AquaEvents>(event: K, listener: AquaEvents[K]): this;
|
|
672
|
+
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
673
|
+
|
|
674
|
+
addListener<K extends keyof AquaEvents>(event: K, listener: AquaEvents[K]): this;
|
|
675
|
+
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
676
|
+
|
|
677
|
+
removeAllListeners<K extends keyof AquaEvents>(event?: K): this;
|
|
678
|
+
removeAllListeners(event?: string | symbol): this;
|
|
679
|
+
}
|
|
680
|
+
export interface PlayerEvents {
|
|
681
|
+
'destroy': () => void;
|
|
682
|
+
'playerUpdate': (packet: any) => void;
|
|
683
|
+
'event': (payload: any) => void;
|
|
684
|
+
'trackStart': (track: Track) => void;
|
|
685
|
+
'trackEnd': (track: Track, reason?: string) => void;
|
|
686
|
+
'trackError': (track: Track, error: any) => void;
|
|
687
|
+
'trackStuck': (track: Track, thresholdMs: number) => void;
|
|
688
|
+
'trackChange': (track: Track, payload: any) => void;
|
|
689
|
+
'socketClosed': (payload: any) => void;
|
|
690
|
+
'lyricsLine': (track: Track, payload: any) => void;
|
|
691
|
+
'lyricsFound': (track: Track, payload: any) => void;
|
|
692
|
+
'lyricsNotFound': (track: Track, payload: any) => void;
|
|
520
693
|
}
|
|
521
694
|
|
|
522
|
-
|
|
695
|
+
interface Player {
|
|
523
696
|
on<K extends keyof PlayerEvents>(event: K, listener: PlayerEvents[K]): this;
|
|
697
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
698
|
+
|
|
524
699
|
once<K extends keyof PlayerEvents>(event: K, listener: PlayerEvents[K]): this;
|
|
700
|
+
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
701
|
+
|
|
525
702
|
emit<K extends keyof PlayerEvents>(event: K, ...args: Parameters<PlayerEvents[K]>): boolean;
|
|
703
|
+
emit(event: string | symbol, ...args: any[]): boolean;
|
|
704
|
+
|
|
705
|
+
off<K extends keyof PlayerEvents>(event: K, listener: PlayerEvents[K]): this;
|
|
706
|
+
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
707
|
+
|
|
708
|
+
removeListener<K extends keyof PlayerEvents>(event: K, listener: PlayerEvents[K]): this;
|
|
709
|
+
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
710
|
+
|
|
711
|
+
addListener<K extends keyof PlayerEvents>(event: K, listener: PlayerEvents[K]): this;
|
|
712
|
+
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
713
|
+
|
|
714
|
+
removeAllListeners<K extends keyof PlayerEvents>(event?: K): this;
|
|
715
|
+
removeAllListeners(event?: string | symbol): this;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
// Missing Player Properties and Methods
|
|
719
|
+
interface Player {
|
|
720
|
+
// Additional properties found in implementation
|
|
721
|
+
self_deaf: boolean;
|
|
722
|
+
self_mute: boolean;
|
|
723
|
+
players: Set<Player>; // For Node class
|
|
724
|
+
|
|
725
|
+
// Internal properties
|
|
726
|
+
_updateBatcher: any;
|
|
727
|
+
_dataStore: Map<string, any>;
|
|
728
|
+
|
|
729
|
+
// Event handler methods (these are called internally)
|
|
730
|
+
trackStart(player: Player, track: Track): Promise<void>;
|
|
731
|
+
trackEnd(player: Player, track: Track, payload: any): Promise<void>;
|
|
732
|
+
trackError(player: Player, track: Track, payload: any): Promise<void>;
|
|
733
|
+
trackStuck(player: Player, track: Track, payload: any): Promise<void>;
|
|
734
|
+
trackChange(player: Player, track: Track, payload: any): Promise<void>;
|
|
735
|
+
socketClosed(player: Player, track: Track, payload: any): Promise<void>;
|
|
736
|
+
lyricsLine(player: Player, track: Track, payload: any): Promise<void>;
|
|
737
|
+
lyricsFound(player: Player, track: Track, payload: any): Promise<void>;
|
|
738
|
+
lyricsNotFound(player: Player, track: Track, payload: any): Promise<void>;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
interface Node {
|
|
742
|
+
// Additional properties found in implementation
|
|
743
|
+
timeout: number;
|
|
744
|
+
maxPayload: number;
|
|
745
|
+
skipUTF8Validation: boolean;
|
|
746
|
+
_isConnecting: boolean;
|
|
747
|
+
_debugEnabled: boolean;
|
|
748
|
+
_headers: Record<string, string>;
|
|
749
|
+
_boundHandlers: Record<string, Function>;
|
|
750
|
+
|
|
751
|
+
// Methods missing from original definitions
|
|
752
|
+
_handleOpen(): Promise<void>;
|
|
753
|
+
_handleError(error: any): void;
|
|
754
|
+
_handleMessage(data: any, isBinary: boolean): void;
|
|
755
|
+
_handleClose(code: number, reason: any): void;
|
|
756
|
+
_handleReady(payload: any): Promise<void>;
|
|
757
|
+
_emitError(error: any): void;
|
|
758
|
+
_emitDebug(message: string | (() => string)): void;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
interface Rest {
|
|
762
|
+
// Additional properties
|
|
763
|
+
timeout: number;
|
|
764
|
+
baseUrl: string;
|
|
765
|
+
defaultHeaders: Record<string, string>;
|
|
766
|
+
agent: any; // HTTP/HTTPS Agent
|
|
767
|
+
|
|
768
|
+
// Missing REST methods found in implementation
|
|
769
|
+
getPlayer(guildId: string): Promise<any>;
|
|
770
|
+
getPlayers(): Promise<any>;
|
|
771
|
+
decodeTrack(encodedTrack: string): Promise<any>;
|
|
772
|
+
decodeTracks(encodedTracks: string[]): Promise<any>;
|
|
773
|
+
getInfo(): Promise<NodeInfo>;
|
|
774
|
+
getVersion(): Promise<string>;
|
|
775
|
+
getRoutePlannerStatus(): Promise<any>;
|
|
776
|
+
freeRoutePlannerAddress(address: string): Promise<any>;
|
|
777
|
+
freeAllRoutePlannerAddresses(): Promise<any>;
|
|
778
|
+
destroy(): void;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
interface Connection {
|
|
782
|
+
// Internal properties found in implementation
|
|
783
|
+
_player: Player;
|
|
784
|
+
_aqua: Aqua;
|
|
785
|
+
_nodes: Node;
|
|
786
|
+
_guildId: string;
|
|
787
|
+
_clientId: string;
|
|
788
|
+
_lastEndpoint: string | null;
|
|
789
|
+
_pendingUpdate: any;
|
|
790
|
+
_updateTimer: NodeJS.Timeout | null;
|
|
791
|
+
_hasDebugListeners: boolean;
|
|
792
|
+
_hasMoveListeners: boolean;
|
|
793
|
+
|
|
794
|
+
// Methods not in original definition
|
|
795
|
+
_extractRegion(endpoint: string): string | null;
|
|
796
|
+
_scheduleVoiceUpdate(isResume?: boolean): void;
|
|
797
|
+
_executeVoiceUpdate(): void;
|
|
798
|
+
_sendUpdate(payload: any): Promise<void>;
|
|
799
|
+
_handleDisconnect(): void;
|
|
800
|
+
_clearPendingUpdate(): void;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
export type EventHandler<T = any> = (...args: T[]) => void | Promise<void>;
|
|
804
|
+
|
|
805
|
+
// Extended ResolveOptions for internal use
|
|
806
|
+
export interface ExtendedResolveOptions extends ResolveOptions {
|
|
807
|
+
node?: Node;
|
|
808
|
+
}
|
|
809
|
+
interface Plugin {
|
|
810
|
+
// Optional unload method should be properly typed
|
|
811
|
+
unload?(aqua: Aqua): void | Promise<void>;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
export const LOOP_MODES: {
|
|
815
|
+
readonly NONE: 0;
|
|
816
|
+
readonly TRACK: 1;
|
|
817
|
+
readonly QUEUE: 2;
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
interface Player {
|
|
821
|
+
readonly EVENT_HANDLERS: Record<string, string>;
|
|
822
|
+
}
|
|
823
|
+
export interface TrackResolutionOptions {
|
|
824
|
+
toFront?: boolean;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// Additional Filter Preset Options
|
|
828
|
+
export interface FilterPresetOptions {
|
|
829
|
+
value?: number;
|
|
830
|
+
rate?: number;
|
|
831
|
+
pitch?: number;
|
|
832
|
+
rotationHz?: number;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
// Error Extensions
|
|
836
|
+
export interface AquaError extends Error {
|
|
837
|
+
statusCode?: number;
|
|
838
|
+
statusMessage?: string;
|
|
839
|
+
headers?: Record<string, string>;
|
|
840
|
+
body?: any;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
// Save/Load Player Data Interfaces
|
|
844
|
+
export interface SavedPlayerData {
|
|
845
|
+
g: string; // guildId
|
|
846
|
+
t: string; // textChannel
|
|
847
|
+
v: string; // voiceChannel
|
|
848
|
+
u: string | null; // uri
|
|
849
|
+
p: number; // position
|
|
850
|
+
ts: number; // timestamp
|
|
851
|
+
q: string[]; // queue uris
|
|
852
|
+
r: string | null; // requester
|
|
853
|
+
vol: number; // volume
|
|
854
|
+
pa: boolean; // paused
|
|
855
|
+
pl: boolean; // playing
|
|
856
|
+
nw: string | null; // nowPlayingMessage id
|
|
526
857
|
}
|
|
527
858
|
}
|