aqualink 2.18.1 → 2.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/handlers/autoplay.js +148 -121
- package/build/handlers/fetchImage.js +152 -148
- package/build/index.d.ts +1401 -1080
- package/build/index.js +23 -12
- package/build/structures/Aqua.js +1085 -896
- package/build/structures/AqualinkEvents.js +43 -45
- package/build/structures/Connection.js +576 -483
- package/build/structures/Filters.js +351 -244
- package/build/structures/Node.js +666 -548
- package/build/structures/Player.js +1143 -904
- package/build/structures/Plugins.js +10 -11
- package/build/structures/Queue.js +129 -111
- package/build/structures/Rest.js +856 -645
- package/build/structures/Track.js +158 -129
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -1,1080 +1,1401 @@
|
|
|
1
|
-
import { EventEmitter } from
|
|
2
|
-
|
|
3
|
-
declare module
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
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
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
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
|
-
|
|
1
|
+
import { EventEmitter } from 'events'
|
|
2
|
+
|
|
3
|
+
declare module 'aqualink' {
|
|
4
|
+
// Main Classes
|
|
5
|
+
export class Aqua extends EventEmitter {
|
|
6
|
+
constructor(client: any, nodes: NodeOptions[], options?: AquaOptions)
|
|
7
|
+
|
|
8
|
+
// Core Properties
|
|
9
|
+
client: any
|
|
10
|
+
nodes: NodeOptions[]
|
|
11
|
+
nodeMap: Map<string, Node>
|
|
12
|
+
players: Map<string, Player>
|
|
13
|
+
clientId: string | null
|
|
14
|
+
initiated: boolean
|
|
15
|
+
version: string
|
|
16
|
+
options: AquaOptions
|
|
17
|
+
failoverOptions: FailoverOptions
|
|
18
|
+
|
|
19
|
+
// Configuration Properties
|
|
20
|
+
shouldDeleteMessage: boolean
|
|
21
|
+
defaultSearchPlatform: SearchSource
|
|
22
|
+
leaveOnEnd: boolean
|
|
23
|
+
restVersion: RestVersion
|
|
24
|
+
plugins: Plugin[]
|
|
25
|
+
autoResume: boolean
|
|
26
|
+
infiniteReconnects: boolean
|
|
27
|
+
urlFilteringEnabled?: boolean
|
|
28
|
+
restrictedDomains: string[]
|
|
29
|
+
allowedDomains: string[]
|
|
30
|
+
loadBalancer: LoadBalancerStrategy
|
|
31
|
+
send: (payload: any) => void
|
|
32
|
+
|
|
33
|
+
// Internal State Management
|
|
34
|
+
_nodeStates: Map<
|
|
35
|
+
string,
|
|
36
|
+
{ connected: boolean; failoverInProgress: boolean }
|
|
37
|
+
>
|
|
38
|
+
_failoverQueue: Map<string, number>
|
|
39
|
+
_lastFailoverAttempt: Map<string, number>
|
|
40
|
+
_brokenPlayers: Map<string, BrokenPlayerState>
|
|
41
|
+
_rebuildLocks: Set<string>
|
|
42
|
+
_leastUsedNodesCache: Node[] | null
|
|
43
|
+
_leastUsedNodesCacheTime: number
|
|
44
|
+
_nodeLoadCache: Map<string, { load: number; time: number }>
|
|
45
|
+
_cleanupTimer: NodeJS.Timer | null
|
|
46
|
+
_onNodeConnect?: (node: Node) => void
|
|
47
|
+
_onNodeDisconnect?: (node: Node) => void
|
|
48
|
+
|
|
49
|
+
// Getters
|
|
50
|
+
get leastUsedNodes(): Node[]
|
|
51
|
+
|
|
52
|
+
// Core Methods
|
|
53
|
+
/**
|
|
54
|
+
* Initializes the specific client id and connects to all nodes
|
|
55
|
+
* @param clientId Client ID
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* await aqua.init(client.user.id);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
init(clientId: string): Promise<Aqua>
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Creates a new node connection
|
|
65
|
+
* @param options Modified node options
|
|
66
|
+
*/
|
|
67
|
+
createNode(options: NodeOptions): Promise<Node>
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Destroys a node by identifier
|
|
71
|
+
* @param identifier Node identifier (name or host)
|
|
72
|
+
*/
|
|
73
|
+
destroyNode(identifier: string): void
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Updates the voice state of a player
|
|
77
|
+
* @param data Voice state update packet
|
|
78
|
+
*/
|
|
79
|
+
updateVoiceState(data: VoiceStateUpdate | VoiceServerUpdate): void
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Fetches nodes in a specific region
|
|
83
|
+
* @param region Region name
|
|
84
|
+
*/
|
|
85
|
+
fetchRegion(region: string): Node[]
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Creates a connection for a player
|
|
89
|
+
* @param options Connection options
|
|
90
|
+
*/
|
|
91
|
+
createConnection(options: ConnectionOptions): Player
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Creates a player on a specific node
|
|
95
|
+
* @param node Node to create player on
|
|
96
|
+
* @param options Player options
|
|
97
|
+
*/
|
|
98
|
+
createPlayer(node: Node, options: PlayerOptions): Player
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Destroys a player
|
|
102
|
+
* @param guildId Guild ID
|
|
103
|
+
*/
|
|
104
|
+
destroyPlayer(guildId: string): Promise<void>
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Resolves a track or playlist
|
|
108
|
+
* @param options Resolution options
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* const result = await aqua.resolve({ query: 'https://...', requester: user });
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
resolve(options: ResolveOptions): Promise<ResolveResponse>
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Gets an existing player
|
|
118
|
+
* @param guildId Guild ID
|
|
119
|
+
*/
|
|
120
|
+
get(guildId: string): Player
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Searches for tracks
|
|
124
|
+
* @param query Search query
|
|
125
|
+
* @param requester Requester object
|
|
126
|
+
* @param source Search source (ytsearch, scsearch, etc)
|
|
127
|
+
*/
|
|
128
|
+
search(
|
|
129
|
+
query: string,
|
|
130
|
+
requester: any,
|
|
131
|
+
source?: SearchSource
|
|
132
|
+
): Promise<Track[] | null>
|
|
133
|
+
|
|
134
|
+
// Save/Load Methods
|
|
135
|
+
savePlayer(filePath?: string): Promise<void>
|
|
136
|
+
savePlayerSync(filePath?: string): void
|
|
137
|
+
loadPlayers(filePath?: string): Promise<void>
|
|
138
|
+
|
|
139
|
+
// Failover and Migration Methods
|
|
140
|
+
handleNodeFailover(failedNode: Node): Promise<void>
|
|
141
|
+
|
|
142
|
+
// Utility Methods
|
|
143
|
+
/**
|
|
144
|
+
* Destroys the Aqua instance and all players
|
|
145
|
+
*/
|
|
146
|
+
destroy(): Promise<void>
|
|
147
|
+
|
|
148
|
+
// Internal Methods
|
|
149
|
+
_invalidateCache(): void
|
|
150
|
+
_getCachedNodeLoad(node: Node): number
|
|
151
|
+
_calculateNodeLoad(node: Node): number
|
|
152
|
+
_createNode(options: NodeOptions): Promise<Node>
|
|
153
|
+
_destroyNode(identifier: string): void
|
|
154
|
+
_cleanupNode(nodeId: string): void
|
|
155
|
+
_storeBrokenPlayers(node: Node): void
|
|
156
|
+
_rebuildBrokenPlayers(node: Node): Promise<void>
|
|
157
|
+
_rebuildPlayer(
|
|
158
|
+
brokenState: BrokenPlayerState,
|
|
159
|
+
targetNode: Node
|
|
160
|
+
): Promise<Player>
|
|
161
|
+
_migratePlayersOptimized(
|
|
162
|
+
players: Player[],
|
|
163
|
+
availableNodes: Node[]
|
|
164
|
+
): Promise<MigrationResult[]>
|
|
165
|
+
_migratePlayer(player: Player, pickNode: () => Node): Promise<Player>
|
|
166
|
+
_capturePlayerState(player: Player): PlayerState | null
|
|
167
|
+
_createPlayerOnNode(
|
|
168
|
+
targetNode: Node,
|
|
169
|
+
playerState: PlayerState
|
|
170
|
+
): Promise<Player>
|
|
171
|
+
_restorePlayerState(
|
|
172
|
+
newPlayer: Player,
|
|
173
|
+
playerState: PlayerState
|
|
174
|
+
): Promise<void>
|
|
175
|
+
_getRequestNode(nodes?: string | Node | Node[]): Node
|
|
176
|
+
_chooseLeastBusyNode(nodes: Node[]): Node | null
|
|
177
|
+
_constructResponse(
|
|
178
|
+
response: any,
|
|
179
|
+
requester: any,
|
|
180
|
+
requestNode: Node
|
|
181
|
+
): ResolveResponse
|
|
182
|
+
_resolveSearchPlatform(source: string): SearchSource
|
|
183
|
+
_getAvailableNodes(excludeNode?: Node): Node[]
|
|
184
|
+
_performCleanup(): void
|
|
185
|
+
_handlePlayerDestroy(player: Player): void
|
|
186
|
+
_waitForFirstNode(timeout?: number): Promise<void>
|
|
187
|
+
_restorePlayer(data: SavedPlayerData): Promise<void>
|
|
188
|
+
_parseRequester(requesterString: string | null): any
|
|
189
|
+
_loadPlugins(): Promise<void>
|
|
190
|
+
_createDefaultSend(): (packet: any) => void
|
|
191
|
+
_bindEventHandlers(): void
|
|
192
|
+
_startCleanupTimer(): void
|
|
193
|
+
_onNodeReady(node: Node, data: { resumed: boolean }): void
|
|
194
|
+
|
|
195
|
+
// Optional bypass checks
|
|
196
|
+
bypassChecks?: { nodeFetchInfo?: boolean }
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export class Node extends EventEmitter {
|
|
200
|
+
constructor(
|
|
201
|
+
aqua: Aqua,
|
|
202
|
+
connOptions: NodeOptions,
|
|
203
|
+
options?: NodeAdditionalOptions
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
// Core Properties
|
|
207
|
+
aqua: Aqua
|
|
208
|
+
host: string
|
|
209
|
+
name: string
|
|
210
|
+
port: number
|
|
211
|
+
auth: string
|
|
212
|
+
ssl: boolean
|
|
213
|
+
sessionId: string | null
|
|
214
|
+
regions: string[]
|
|
215
|
+
wsUrl: string
|
|
216
|
+
rest: Rest
|
|
217
|
+
resumeTimeout: number
|
|
218
|
+
autoResume: boolean
|
|
219
|
+
reconnectTimeout: number
|
|
220
|
+
reconnectTries: number
|
|
221
|
+
infiniteReconnects: boolean
|
|
222
|
+
connected: boolean
|
|
223
|
+
info: NodeInfo | null
|
|
224
|
+
isNodelink: boolean
|
|
225
|
+
ws: any | null // WebSocket
|
|
226
|
+
reconnectAttempted: number
|
|
227
|
+
reconnectTimeoutId: NodeJS.Timeout | null
|
|
228
|
+
isDestroyed: boolean
|
|
229
|
+
stats: NodeStats
|
|
230
|
+
players: Set<Player>
|
|
231
|
+
options: NodeOptions
|
|
232
|
+
|
|
233
|
+
// Additional Properties
|
|
234
|
+
timeout: number
|
|
235
|
+
maxPayload: number
|
|
236
|
+
skipUTF8Validation: boolean
|
|
237
|
+
_isConnecting: boolean
|
|
238
|
+
_debugEnabled: boolean
|
|
239
|
+
_headers: Record<string, string>
|
|
240
|
+
_boundHandlers: Record<string, ReturnType<typeof this._boundHandlers>>
|
|
241
|
+
|
|
242
|
+
// Methods
|
|
243
|
+
connect(): Promise<void>
|
|
244
|
+
destroy(clean?: boolean): void
|
|
245
|
+
getStats(): Promise<NodeStats>
|
|
246
|
+
|
|
247
|
+
// Internal Methods
|
|
248
|
+
_handleOpen(): Promise<void>
|
|
249
|
+
_handleError(error: any): void
|
|
250
|
+
_handleMessage(data: any, isBinary: boolean): void
|
|
251
|
+
_handleClose(code: number, reason: any): void
|
|
252
|
+
_handleReady(payload: any): Promise<void>
|
|
253
|
+
_resumePlayers(): Promise<void>
|
|
254
|
+
_emitError(error: any): void
|
|
255
|
+
_emitDebug(message: string | (() => string)): void
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export class Player extends EventEmitter {
|
|
259
|
+
constructor(aqua: Aqua, nodes: Node, options: PlayerOptions)
|
|
260
|
+
|
|
261
|
+
// Static Properties
|
|
262
|
+
static readonly LOOP_MODES: {
|
|
263
|
+
readonly NONE: 0
|
|
264
|
+
readonly TRACK: 1
|
|
265
|
+
readonly QUEUE: 2
|
|
266
|
+
}
|
|
267
|
+
static readonly EVENT_HANDLERS: Record<string, string>
|
|
268
|
+
|
|
269
|
+
// Core Properties
|
|
270
|
+
aqua: Aqua
|
|
271
|
+
nodes: Node
|
|
272
|
+
guildId: string
|
|
273
|
+
textChannel: string
|
|
274
|
+
voiceChannel: string
|
|
275
|
+
connection: Connection
|
|
276
|
+
filters: Filters
|
|
277
|
+
state: number
|
|
278
|
+
txId: number
|
|
279
|
+
volume: number
|
|
280
|
+
loop: LoopModeName | LoopMode
|
|
281
|
+
queue: Queue
|
|
282
|
+
shouldDeleteMessage: boolean
|
|
283
|
+
leaveOnEnd: boolean
|
|
284
|
+
playing: boolean
|
|
285
|
+
paused: boolean
|
|
286
|
+
connected: boolean
|
|
287
|
+
destroyed: boolean
|
|
288
|
+
current: Track | null
|
|
289
|
+
position: number
|
|
290
|
+
timestamp: number
|
|
291
|
+
ping: number
|
|
292
|
+
nowPlayingMessage: any
|
|
293
|
+
isAutoplayEnabled: boolean
|
|
294
|
+
isAutoplay: boolean
|
|
295
|
+
autoplaySeed: AutoplaySeed | null
|
|
296
|
+
deaf: boolean
|
|
297
|
+
mute: boolean
|
|
298
|
+
autoplayRetries: number
|
|
299
|
+
reconnectionRetries: number
|
|
300
|
+
_resuming: boolean
|
|
301
|
+
_reconnecting: boolean
|
|
302
|
+
previousIdentifiers: Set<string>
|
|
303
|
+
self_deaf: boolean
|
|
304
|
+
self_mute: boolean
|
|
305
|
+
|
|
306
|
+
// Additional Internal Properties
|
|
307
|
+
previousTracks: CircularBuffer
|
|
308
|
+
_updateBatcher: MicrotaskUpdateBatcher
|
|
309
|
+
_dataStore: Map<string, any> | null
|
|
310
|
+
_voiceDownSince: number
|
|
311
|
+
_voiceRecovering: boolean
|
|
312
|
+
_voiceWatchdogTimer: NodeJS.Timer | null
|
|
313
|
+
_boundPlayerUpdate: (packet: any) => void
|
|
314
|
+
_boundEvent: (payload: any) => void
|
|
315
|
+
_boundAquaPlayerMove: (oldChannel: string, newChannel: string) => void
|
|
316
|
+
_lastVoiceChannel: string | null
|
|
317
|
+
_lastTextChannel: string | null
|
|
318
|
+
|
|
319
|
+
// Getters
|
|
320
|
+
get previous(): Track | null
|
|
321
|
+
get currenttrack(): Track | null
|
|
322
|
+
|
|
323
|
+
// Core Methods
|
|
324
|
+
/**
|
|
325
|
+
* Plays a track. If no track is provided, plays the next track in the queue.
|
|
326
|
+
* @param track The track to play
|
|
327
|
+
* @param options Options for playback
|
|
328
|
+
* @example
|
|
329
|
+
* ```ts
|
|
330
|
+
* // Play the next track in the queue
|
|
331
|
+
* await player.play();
|
|
332
|
+
*
|
|
333
|
+
* // Play a specific track
|
|
334
|
+
* await player.play(track);
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
play(track?: Track | null, options?: { paused?: boolean; startTime?: number; noReplace?: boolean }): Promise<Player>
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Connects the player to a voice channel
|
|
341
|
+
* @param options Connection options
|
|
342
|
+
* @example
|
|
343
|
+
* ```ts
|
|
344
|
+
* player.connect({
|
|
345
|
+
* guildId: '...',
|
|
346
|
+
* voiceChannel: '...',
|
|
347
|
+
* deaf: true
|
|
348
|
+
* });
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
351
|
+
connect(options?: ConnectionOptions): Player
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Destroys the player and optionally cleans up resources
|
|
355
|
+
* @param options Destruction options
|
|
356
|
+
*/
|
|
357
|
+
destroy(options?: {
|
|
358
|
+
preserveClient?: boolean
|
|
359
|
+
skipRemote?: boolean
|
|
360
|
+
preserveMessage?: boolean
|
|
361
|
+
preserveReconnecting?: boolean
|
|
362
|
+
preserveTracks?: boolean
|
|
363
|
+
}): Player
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Pauses or resumes the player
|
|
367
|
+
* @param paused Whether to pause
|
|
368
|
+
*/
|
|
369
|
+
pause(paused: boolean): Player
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Seeks to a position in the current track
|
|
373
|
+
* @param position Position in milliseconds
|
|
374
|
+
*/
|
|
375
|
+
seek(position: number): Player
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Stops the playback
|
|
379
|
+
*/
|
|
380
|
+
stop(): Player
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Sets the player volume
|
|
384
|
+
* @param volume Volume (0-1000)
|
|
385
|
+
*/
|
|
386
|
+
setVolume(volume: number): Player
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Sets the loop mode
|
|
390
|
+
* @param mode Loop mode (off, track, queue)
|
|
391
|
+
*/
|
|
392
|
+
setLoop(mode: LoopMode | LoopModeName): Player
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Sets the text channel for the player
|
|
396
|
+
* @param channel Channel ID
|
|
397
|
+
*/
|
|
398
|
+
setTextChannel(channel: string): Player
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Sets the voice channel and moves the player
|
|
402
|
+
* @param channel Channel ID
|
|
403
|
+
*/
|
|
404
|
+
setVoiceChannel(channel: string): Player
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Disconnects the player from voice
|
|
408
|
+
*/
|
|
409
|
+
disconnect(): Player
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Shuffles the queue
|
|
413
|
+
*/
|
|
414
|
+
shuffle(): Player
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Gets the player queue
|
|
418
|
+
*/
|
|
419
|
+
getQueue(): Queue
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Replays the current track from the beginning
|
|
423
|
+
*/
|
|
424
|
+
replay(): Player
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Skips the current track
|
|
428
|
+
*/
|
|
429
|
+
skip(): Player
|
|
430
|
+
|
|
431
|
+
// Advanced Methods
|
|
432
|
+
getLyrics(options?: LyricsOptions): Promise<LyricsResponse | null>
|
|
433
|
+
subscribeLiveLyrics(): Promise<any>
|
|
434
|
+
unsubscribeLiveLyrics(): Promise<any>
|
|
435
|
+
liveLyrics(guildId: string, state: boolean): Promise<any>
|
|
436
|
+
autoplay(): Promise<Player>
|
|
437
|
+
setAutoplay(enabled: boolean): Player
|
|
438
|
+
updatePlayer(data: any): Promise<any>
|
|
439
|
+
cleanup(): Promise<void>
|
|
440
|
+
getActiveMixer(guildId: string): Promise<any[]>
|
|
441
|
+
updateMixerVolume(
|
|
442
|
+
guildId: string,
|
|
443
|
+
mix: string,
|
|
444
|
+
volume: number
|
|
445
|
+
): Promise<any>
|
|
446
|
+
removeMixer(guildId: string, mix: string): Promise<any>
|
|
447
|
+
addMixer(guildId: string, options: MixerOptions): Promise<any>
|
|
448
|
+
getLoadLyrics(encodedTrack: string): Promise<LyricsResponse | null>
|
|
449
|
+
|
|
450
|
+
// Data Methods
|
|
451
|
+
set(key: string, value: any): void
|
|
452
|
+
get(key: string): any
|
|
453
|
+
clearData(): Player
|
|
454
|
+
|
|
455
|
+
// Utility Methods
|
|
456
|
+
send(data: any): void
|
|
457
|
+
batchUpdatePlayer(data: any, immediate?: boolean): Promise<void>
|
|
458
|
+
|
|
459
|
+
// Internal Methods
|
|
460
|
+
_parseLoop(loop: any): LoopMode
|
|
461
|
+
_bindEvents(): void
|
|
462
|
+
_startWatchdog(): void
|
|
463
|
+
_handlePlayerUpdate(packet: any): void
|
|
464
|
+
_handleEvent(payload: any): Promise<void>
|
|
465
|
+
_voiceWatchdog(): Promise<void>
|
|
466
|
+
_attemptVoiceResume(): Promise<void>
|
|
467
|
+
_getAutoplayTrack(
|
|
468
|
+
sourceName: string,
|
|
469
|
+
identifier: string,
|
|
470
|
+
uri: string,
|
|
471
|
+
requester: any,
|
|
472
|
+
prev: Track
|
|
473
|
+
): Promise<Track | null>
|
|
474
|
+
_handleAquaPlayerMove(oldChannel: string, newChannel: string): void
|
|
475
|
+
|
|
476
|
+
// Event handler methods (called internally)
|
|
477
|
+
trackStart(player: Player, track: Track): Promise<void>
|
|
478
|
+
trackEnd(player: Player, track: Track, payload: any): Promise<void>
|
|
479
|
+
trackError(player: Player, track: Track, payload: any): Promise<void>
|
|
480
|
+
trackStuck(player: Player, track: Track, payload: any): Promise<void>
|
|
481
|
+
trackChange(player: Player, track: Track, payload: any): Promise<void>
|
|
482
|
+
socketClosed(player: Player, track: Track, payload: any): Promise<void>
|
|
483
|
+
lyricsLine(player: Player, track: Track, payload: any): Promise<void>
|
|
484
|
+
lyricsFound(player: Player, track: Track, payload: any): Promise<void>
|
|
485
|
+
lyricsNotFound(player: Player, track: Track, payload: any): Promise<void>
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export class Track {
|
|
489
|
+
constructor(data?: TrackData, requester?: any, node?: Node)
|
|
490
|
+
|
|
491
|
+
// Properties
|
|
492
|
+
identifier: string
|
|
493
|
+
isSeekable: boolean
|
|
494
|
+
author: string
|
|
495
|
+
position: number
|
|
496
|
+
duration: number
|
|
497
|
+
isStream: boolean
|
|
498
|
+
title: string
|
|
499
|
+
uri: string
|
|
500
|
+
sourceName: string
|
|
501
|
+
artworkUrl: string
|
|
502
|
+
track: string | null
|
|
503
|
+
playlist: PlaylistInfo | null
|
|
504
|
+
requester: any
|
|
505
|
+
nodes: Node
|
|
506
|
+
node: Node | null
|
|
507
|
+
|
|
508
|
+
// Internal Properties
|
|
509
|
+
_infoCache: TrackInfo | null
|
|
510
|
+
|
|
511
|
+
// Getters
|
|
512
|
+
get info(): TrackInfo
|
|
513
|
+
get length(): number
|
|
514
|
+
get thumbnail(): string
|
|
515
|
+
|
|
516
|
+
// Methods
|
|
517
|
+
/**
|
|
518
|
+
* Resolves local artwork/thumbnail
|
|
519
|
+
*/
|
|
520
|
+
resolveThumbnail(url?: string): string | null
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Resolves the track if it needs (re)resolution
|
|
524
|
+
*/
|
|
525
|
+
resolve(aqua: Aqua, opts?: TrackResolutionOptions): Promise<Track | null>
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Checks if the track is valid
|
|
529
|
+
*/
|
|
530
|
+
isValid(): boolean
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Disposes the track and frees resources
|
|
534
|
+
*/
|
|
535
|
+
dispose(): void
|
|
536
|
+
|
|
537
|
+
// Internal Methods
|
|
538
|
+
_computeArtworkFromKnownSources(): string | null
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
export class Rest {
|
|
542
|
+
constructor(aqua: Aqua, node: Node)
|
|
543
|
+
|
|
544
|
+
aqua: Aqua
|
|
545
|
+
node: Node
|
|
546
|
+
sessionId: string
|
|
547
|
+
calls: number
|
|
548
|
+
|
|
549
|
+
// Additional Properties
|
|
550
|
+
timeout: number
|
|
551
|
+
baseUrl: string
|
|
552
|
+
defaultHeaders: Record<string, string>
|
|
553
|
+
agent: any // HTTP/HTTPS Agent
|
|
554
|
+
useHttp2: boolean
|
|
555
|
+
|
|
556
|
+
// Core Methods
|
|
557
|
+
/**
|
|
558
|
+
* Sets the session ID for the REST connection
|
|
559
|
+
* @param sessionId The session ID
|
|
560
|
+
*/
|
|
561
|
+
setSessionId(sessionId: string): void
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Makes a generic request to the Lavalink REST API
|
|
565
|
+
* @param method HTTP method
|
|
566
|
+
* @param endpoint API endpoint
|
|
567
|
+
* @param body Request body
|
|
568
|
+
*/
|
|
569
|
+
makeRequest(method: HttpMethod, endpoint: string, body?: any): Promise<any>
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Updates a player via REST
|
|
573
|
+
* @param options Update options
|
|
574
|
+
*/
|
|
575
|
+
updatePlayer(options: UpdatePlayerOptions): Promise<any>
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Destroys a player via REST
|
|
579
|
+
* @param guildId Guild ID
|
|
580
|
+
*/
|
|
581
|
+
destroyPlayer(guildId: string): Promise<any>
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Gets lyrics for a track
|
|
585
|
+
* @param options Lyrics options
|
|
586
|
+
*/
|
|
587
|
+
getLyrics(options: GetLyricsOptions): Promise<LyricsResponse>
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Subscribes to live lyrics events
|
|
591
|
+
* @param guildId Guild ID
|
|
592
|
+
* @param sync Whether to sync with playback
|
|
593
|
+
*/
|
|
594
|
+
subscribeLiveLyrics(guildId: string, sync?: boolean): Promise<any>
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Unsubscribes from live lyrics
|
|
598
|
+
* @param guildId Guild ID
|
|
599
|
+
*/
|
|
600
|
+
unsubscribeLiveLyrics(guildId: string): Promise<any>
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Gets node statistics
|
|
604
|
+
*/
|
|
605
|
+
getStats(): Promise<NodeStats>
|
|
606
|
+
|
|
607
|
+
// Additional REST Methods
|
|
608
|
+
getPlayer(guildId: string): Promise<any>
|
|
609
|
+
getPlayers(): Promise<any>
|
|
610
|
+
decodeTrack(encodedTrack: string): Promise<any>
|
|
611
|
+
decodeTracks(encodedTracks: string[]): Promise<any>
|
|
612
|
+
getInfo(): Promise<NodeInfo>
|
|
613
|
+
getVersion(): Promise<string>
|
|
614
|
+
getRoutePlannerStatus(): Promise<any>
|
|
615
|
+
freeRoutePlannerAddress(address: string): Promise<any>
|
|
616
|
+
freeAllRoutePlannerAddresses(): Promise<any>
|
|
617
|
+
addMixer(guildId: string, options: MixerOptions): Promise<any>
|
|
618
|
+
getActiveMixer(guildId: string): Promise<any[]>
|
|
619
|
+
updateMixerVolume(
|
|
620
|
+
guildId: string,
|
|
621
|
+
mix: string,
|
|
622
|
+
volume: number
|
|
623
|
+
): Promise<any>
|
|
624
|
+
removeMixer(guildId: string, mix: string): Promise<any>
|
|
625
|
+
getLoadLyrics(encodedTrack: string): Promise<LyricsResponse>
|
|
626
|
+
loadTracks(identifier: string): Promise<any>
|
|
627
|
+
destroy(): void
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
export class Queue extends Array<Track> {
|
|
631
|
+
constructor(...elements: Track[])
|
|
632
|
+
|
|
633
|
+
// Properties
|
|
634
|
+
readonly size: number
|
|
635
|
+
readonly first: Track | null
|
|
636
|
+
readonly last: Track | null
|
|
637
|
+
|
|
638
|
+
// Methods
|
|
639
|
+
/**
|
|
640
|
+
* Adds a track to the queue
|
|
641
|
+
* @param track Track to add
|
|
642
|
+
*/
|
|
643
|
+
add(track: Track): Queue
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Adds multiple tracks to the queue
|
|
647
|
+
* @param tracks Tracks to add
|
|
648
|
+
*/
|
|
649
|
+
add(...tracks: Track[]): Queue
|
|
650
|
+
|
|
651
|
+
push(track: Track): number
|
|
652
|
+
unshift(track: Track): number
|
|
653
|
+
shift(): Track | undefined
|
|
654
|
+
remove(track: Track): boolean
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Clears the queue
|
|
658
|
+
*/
|
|
659
|
+
clear(): void
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Shuffles the queue
|
|
663
|
+
*/
|
|
664
|
+
shuffle(): Queue
|
|
665
|
+
|
|
666
|
+
peek(): Track | null
|
|
667
|
+
isEmpty(): boolean
|
|
668
|
+
toArray(): Track[]
|
|
669
|
+
at(index: number): Track | null
|
|
670
|
+
dequeue(): Track | undefined
|
|
671
|
+
enqueue(track: Track): Queue
|
|
672
|
+
move(from: number, to: number): Queue
|
|
673
|
+
swap(index1: number, index2: number): Queue
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
export class Filters {
|
|
677
|
+
constructor(player: Player, options?: FilterOptions)
|
|
678
|
+
|
|
679
|
+
player: Player
|
|
680
|
+
_pendingUpdate: boolean
|
|
681
|
+
|
|
682
|
+
filters: {
|
|
683
|
+
volume: number
|
|
684
|
+
equalizer: EqualizerBand[]
|
|
685
|
+
karaoke: KaraokeSettings | null
|
|
686
|
+
timescale: TimescaleSettings | null
|
|
687
|
+
tremolo: TremoloSettings | null
|
|
688
|
+
vibrato: VibratoSettings | null
|
|
689
|
+
rotation: RotationSettings | null
|
|
690
|
+
distortion: DistortionSettings | null
|
|
691
|
+
channelMix: ChannelMixSettings | null
|
|
692
|
+
lowPass: LowPassSettings | null
|
|
693
|
+
}
|
|
694
|
+
presets: {
|
|
695
|
+
bassboost: number | null
|
|
696
|
+
slowmode: boolean | null
|
|
697
|
+
nightcore: boolean | null
|
|
698
|
+
vaporwave: boolean | null
|
|
699
|
+
_8d: boolean | null
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
// Filter Methods
|
|
703
|
+
setEqualizer(bands: EqualizerBand[]): Filters
|
|
704
|
+
setKaraoke(enabled: boolean, options?: KaraokeSettings): Filters
|
|
705
|
+
setTimescale(enabled: boolean, options?: TimescaleSettings): Filters
|
|
706
|
+
setTremolo(enabled: boolean, options?: TremoloSettings): Filters
|
|
707
|
+
setVibrato(enabled: boolean, options?: VibratoSettings): Filters
|
|
708
|
+
setRotation(enabled: boolean, options?: RotationSettings): Filters
|
|
709
|
+
setDistortion(enabled: boolean, options?: DistortionSettings): Filters
|
|
710
|
+
setChannelMix(enabled: boolean, options?: ChannelMixSettings): Filters
|
|
711
|
+
setLowPass(enabled: boolean, options?: LowPassSettings): Filters
|
|
712
|
+
setBassboost(enabled: boolean, options?: { value?: number }): Filters
|
|
713
|
+
setSlowmode(enabled: boolean, options?: { rate?: number }): Filters
|
|
714
|
+
setNightcore(enabled: boolean, options?: { rate?: number }): Filters
|
|
715
|
+
setVaporwave(enabled: boolean, options?: { pitch?: number }): Filters
|
|
716
|
+
set8D(enabled: boolean, options?: { rotationHz?: number }): Filters
|
|
717
|
+
clearFilters(): Promise<Filters>
|
|
718
|
+
updateFilters(): Promise<Filters>
|
|
719
|
+
|
|
720
|
+
// Internal Methods
|
|
721
|
+
_setFilter(filterName: string, enabled: boolean, options?: any): Filters
|
|
722
|
+
_scheduleUpdate(): Filters
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
export class Connection {
|
|
726
|
+
constructor(player: Player)
|
|
727
|
+
|
|
728
|
+
voiceChannel: string
|
|
729
|
+
sessionId: string | null
|
|
730
|
+
endpoint: string | null
|
|
731
|
+
token: string | null
|
|
732
|
+
region: string | null
|
|
733
|
+
sequence: number
|
|
734
|
+
|
|
735
|
+
// Internal Properties
|
|
736
|
+
_player: Player
|
|
737
|
+
_aqua: Aqua
|
|
738
|
+
_nodes: Node
|
|
739
|
+
_guildId: string
|
|
740
|
+
_clientId: string
|
|
741
|
+
_lastEndpoint: string | null
|
|
742
|
+
_pendingUpdate: any
|
|
743
|
+
_updateTimer: NodeJS.Timeout | null
|
|
744
|
+
_hasDebugListeners: boolean
|
|
745
|
+
_hasMoveListeners: boolean
|
|
746
|
+
_lastSentVoiceKey: string
|
|
747
|
+
_lastVoiceDataUpdate: number
|
|
748
|
+
_stateFlags: number
|
|
749
|
+
|
|
750
|
+
// Methods
|
|
751
|
+
setServerUpdate(data: VoiceServerUpdate['d']): void
|
|
752
|
+
setStateUpdate(data: VoiceStateUpdate['d']): void
|
|
753
|
+
updateSequence(seq: number): void
|
|
754
|
+
destroy(): void
|
|
755
|
+
attemptResume(): Promise<boolean>
|
|
756
|
+
resendVoiceUpdate(): boolean
|
|
757
|
+
|
|
758
|
+
// Internal Methods
|
|
759
|
+
_extractRegion(endpoint: string): string | null
|
|
760
|
+
_scheduleVoiceUpdate(isResume?: boolean): void
|
|
761
|
+
_executeVoiceUpdate(): void
|
|
762
|
+
_sendUpdate(payload: any): Promise<void>
|
|
763
|
+
_handleDisconnect(): void
|
|
764
|
+
_clearPendingUpdate(): void
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
export class Plugin {
|
|
768
|
+
constructor(name: string)
|
|
769
|
+
name: string
|
|
770
|
+
load(aqua: Aqua): void | Promise<void>
|
|
771
|
+
unload?(aqua: Aqua): void | Promise<void>
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// Utility Classes
|
|
775
|
+
export class MicrotaskUpdateBatcher {
|
|
776
|
+
constructor(player: Player)
|
|
777
|
+
player: Player | null
|
|
778
|
+
updates: any
|
|
779
|
+
scheduled: number
|
|
780
|
+
flush: () => Promise<void>
|
|
781
|
+
|
|
782
|
+
batch(data: any, immediate?: boolean): Promise<void>
|
|
783
|
+
destroy(): void
|
|
784
|
+
_flush(): Promise<void>
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
export class CircularBuffer {
|
|
788
|
+
constructor(size?: number)
|
|
789
|
+
buffer: any[]
|
|
790
|
+
size: number
|
|
791
|
+
index: number
|
|
792
|
+
count: number
|
|
793
|
+
|
|
794
|
+
push(item: any): void
|
|
795
|
+
getLast(): any
|
|
796
|
+
clear(): void
|
|
797
|
+
toArray(): any[]
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// Configuration Interfaces
|
|
801
|
+
export interface AquaOptions {
|
|
802
|
+
shouldDeleteMessage?: boolean
|
|
803
|
+
defaultSearchPlatform?: SearchSource
|
|
804
|
+
leaveOnEnd?: boolean
|
|
805
|
+
restVersion?: RestVersion
|
|
806
|
+
plugins?: Plugin[]
|
|
807
|
+
send?: (payload: any) => void
|
|
808
|
+
autoResume?: boolean
|
|
809
|
+
infiniteReconnects?: boolean
|
|
810
|
+
urlFilteringEnabled?: boolean
|
|
811
|
+
restrictedDomains?: string[]
|
|
812
|
+
allowedDomains?: string[]
|
|
813
|
+
loadBalancer?: LoadBalancerStrategy
|
|
814
|
+
failoverOptions?: FailoverOptions
|
|
815
|
+
useHttp2?: boolean
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
export interface FailoverOptions {
|
|
819
|
+
enabled?: boolean
|
|
820
|
+
maxRetries?: number
|
|
821
|
+
retryDelay?: number
|
|
822
|
+
preservePosition?: boolean
|
|
823
|
+
resumePlayback?: boolean
|
|
824
|
+
cooldownTime?: number
|
|
825
|
+
maxFailoverAttempts?: number
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
export interface NodeOptions {
|
|
829
|
+
host: string
|
|
830
|
+
name?: string
|
|
831
|
+
port?: number | string
|
|
832
|
+
auth?: string
|
|
833
|
+
ssl?: boolean
|
|
834
|
+
sessionId?: string
|
|
835
|
+
regions?: string[]
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
export interface NodeAdditionalOptions {
|
|
839
|
+
resumeTimeout?: number
|
|
840
|
+
autoResume?: boolean
|
|
841
|
+
reconnectTimeout?: number
|
|
842
|
+
reconnectTries?: number
|
|
843
|
+
infiniteReconnects?: boolean
|
|
844
|
+
timeout?: number
|
|
845
|
+
maxPayload?: number
|
|
846
|
+
skipUTF8Validation?: boolean
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
export interface PlayerOptions {
|
|
850
|
+
guildId: string
|
|
851
|
+
textChannel: string
|
|
852
|
+
voiceChannel: string
|
|
853
|
+
defaultVolume?: number
|
|
854
|
+
loop?: LoopModeName
|
|
855
|
+
deaf?: boolean
|
|
856
|
+
mute?: boolean
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
export interface ConnectionOptions {
|
|
860
|
+
guildId: string
|
|
861
|
+
voiceChannel: string
|
|
862
|
+
textChannel?: string
|
|
863
|
+
deaf?: boolean
|
|
864
|
+
mute?: boolean
|
|
865
|
+
defaultVolume?: number
|
|
866
|
+
region?: string
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
export interface ResolveOptions {
|
|
870
|
+
query: string
|
|
871
|
+
source?: SearchSource | string
|
|
872
|
+
requester: any
|
|
873
|
+
nodes?: string | Node | Node[]
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
// Response and Data Interfaces
|
|
877
|
+
export interface ResolveResponse {
|
|
878
|
+
loadType: LoadType
|
|
879
|
+
exception: LavalinkException | null
|
|
880
|
+
playlistInfo: PlaylistInfo | null
|
|
881
|
+
pluginInfo: Record<string, any>
|
|
882
|
+
tracks: Track[]
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
export interface NodeStats {
|
|
886
|
+
players: number
|
|
887
|
+
playingPlayers: number
|
|
888
|
+
uptime: number
|
|
889
|
+
memory: {
|
|
890
|
+
free: number
|
|
891
|
+
used: number
|
|
892
|
+
allocated: number
|
|
893
|
+
reservable: number
|
|
894
|
+
}
|
|
895
|
+
cpu: {
|
|
896
|
+
cores: number
|
|
897
|
+
systemLoad: number
|
|
898
|
+
lavalinkLoad: number
|
|
899
|
+
}
|
|
900
|
+
frameStats: {
|
|
901
|
+
sent: number
|
|
902
|
+
nulled: number
|
|
903
|
+
deficit: number
|
|
904
|
+
}
|
|
905
|
+
ping?: number
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
export interface NodeInfo {
|
|
909
|
+
version: {
|
|
910
|
+
semver: string
|
|
911
|
+
major: number
|
|
912
|
+
minor: number
|
|
913
|
+
patch: number
|
|
914
|
+
}
|
|
915
|
+
buildTime: number
|
|
916
|
+
git: {
|
|
917
|
+
branch: string
|
|
918
|
+
commit: string
|
|
919
|
+
commitTime: number
|
|
920
|
+
}
|
|
921
|
+
jvm: string
|
|
922
|
+
lavaplayer: string
|
|
923
|
+
sourceManagers: string[]
|
|
924
|
+
filters: string[]
|
|
925
|
+
plugins: Array<{
|
|
926
|
+
name: string
|
|
927
|
+
version: string
|
|
928
|
+
}>
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
export interface TrackInfo {
|
|
932
|
+
identifier: string
|
|
933
|
+
isSeekable: boolean
|
|
934
|
+
author: string
|
|
935
|
+
length: number
|
|
936
|
+
isStream: boolean
|
|
937
|
+
title: string
|
|
938
|
+
uri: string
|
|
939
|
+
sourceName: string
|
|
940
|
+
artworkUrl: string
|
|
941
|
+
position?: number
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
export interface TrackData {
|
|
945
|
+
encoded?: string
|
|
946
|
+
track?: string
|
|
947
|
+
info: TrackInfo
|
|
948
|
+
playlist?: PlaylistInfo
|
|
949
|
+
node?: Node
|
|
950
|
+
nodes?: Node
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
export interface PlaylistInfo {
|
|
954
|
+
name: string
|
|
955
|
+
selectedTrack?: number
|
|
956
|
+
thumbnail?: string
|
|
957
|
+
title?: string
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
export interface LavalinkException {
|
|
961
|
+
message: string
|
|
962
|
+
severity: string
|
|
963
|
+
cause: string
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
// Filter Interfaces
|
|
967
|
+
export interface FilterOptions {
|
|
968
|
+
volume?: number
|
|
969
|
+
equalizer?: EqualizerBand[]
|
|
970
|
+
karaoke?: KaraokeSettings
|
|
971
|
+
timescale?: TimescaleSettings
|
|
972
|
+
tremolo?: TremoloSettings
|
|
973
|
+
vibrato?: VibratoSettings
|
|
974
|
+
rotation?: RotationSettings
|
|
975
|
+
distortion?: DistortionSettings
|
|
976
|
+
channelMix?: ChannelMixSettings
|
|
977
|
+
lowPass?: LowPassSettings
|
|
978
|
+
bassboost?: number
|
|
979
|
+
slowmode?: boolean
|
|
980
|
+
nightcore?: boolean
|
|
981
|
+
vaporwave?: boolean
|
|
982
|
+
_8d?: boolean
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
export interface EqualizerBand {
|
|
986
|
+
band: number
|
|
987
|
+
gain: number
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
export interface KaraokeSettings {
|
|
991
|
+
level?: number
|
|
992
|
+
monoLevel?: number
|
|
993
|
+
filterBand?: number
|
|
994
|
+
filterWidth?: number
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
export interface TimescaleSettings {
|
|
998
|
+
speed?: number
|
|
999
|
+
pitch?: number
|
|
1000
|
+
rate?: number
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
export interface TremoloSettings {
|
|
1004
|
+
frequency?: number
|
|
1005
|
+
depth?: number
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
export interface VibratoSettings {
|
|
1009
|
+
frequency?: number
|
|
1010
|
+
depth?: number
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
export interface RotationSettings {
|
|
1014
|
+
rotationHz?: number
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
export interface DistortionSettings {
|
|
1018
|
+
distortion?: number
|
|
1019
|
+
sinOffset?: number
|
|
1020
|
+
sinScale?: number
|
|
1021
|
+
cosOffset?: number
|
|
1022
|
+
cosScale?: number
|
|
1023
|
+
tanOffset?: number
|
|
1024
|
+
tanScale?: number
|
|
1025
|
+
offset?: number
|
|
1026
|
+
scale?: number
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
export interface ChannelMixSettings {
|
|
1030
|
+
leftToLeft?: number
|
|
1031
|
+
leftToRight?: number
|
|
1032
|
+
rightToLeft?: number
|
|
1033
|
+
rightToRight?: number
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
export interface LowPassSettings {
|
|
1037
|
+
smoothing?: number
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
export interface MixerOptions {
|
|
1041
|
+
identifier?: string
|
|
1042
|
+
encoded?: string
|
|
1043
|
+
userData?: any
|
|
1044
|
+
volume?: number
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
// Voice Update Interfaces
|
|
1048
|
+
export interface VoiceStateUpdate {
|
|
1049
|
+
d: {
|
|
1050
|
+
guild_id: string
|
|
1051
|
+
channel_id: string | null
|
|
1052
|
+
user_id: string
|
|
1053
|
+
session_id: string
|
|
1054
|
+
deaf: boolean
|
|
1055
|
+
mute: boolean
|
|
1056
|
+
self_deaf: boolean
|
|
1057
|
+
self_mute: boolean
|
|
1058
|
+
suppress: boolean
|
|
1059
|
+
request_to_speak_timestamp: string | null
|
|
1060
|
+
}
|
|
1061
|
+
t: 'VOICE_STATE_UPDATE'
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
export interface VoiceServerUpdate {
|
|
1065
|
+
d: {
|
|
1066
|
+
token: string
|
|
1067
|
+
guild_id: string
|
|
1068
|
+
endpoint: string | null
|
|
1069
|
+
}
|
|
1070
|
+
t: 'VOICE_SERVER_UPDATE'
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
// Utility Interfaces
|
|
1074
|
+
export interface LyricsOptions {
|
|
1075
|
+
query?: string
|
|
1076
|
+
useCurrentTrack?: boolean
|
|
1077
|
+
skipTrackSource?: boolean
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
export interface LyricsResponse {
|
|
1081
|
+
text?: string
|
|
1082
|
+
source?: string
|
|
1083
|
+
lines?: Array<{
|
|
1084
|
+
line: string
|
|
1085
|
+
timestamp?: number
|
|
1086
|
+
}>
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
export interface AutoplaySeed {
|
|
1090
|
+
trackId: string
|
|
1091
|
+
artistIds: string
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
export interface UpdatePlayerOptions {
|
|
1095
|
+
guildId: string
|
|
1096
|
+
data: {
|
|
1097
|
+
track?: { encoded: string | null }
|
|
1098
|
+
position?: number
|
|
1099
|
+
volume?: number
|
|
1100
|
+
paused?: boolean
|
|
1101
|
+
filters?: any
|
|
1102
|
+
voice?: any
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
export interface GetLyricsOptions {
|
|
1107
|
+
track: {
|
|
1108
|
+
info: TrackInfo
|
|
1109
|
+
encoded?: string
|
|
1110
|
+
identifier?: string
|
|
1111
|
+
guild_id?: string
|
|
1112
|
+
}
|
|
1113
|
+
skipTrackSource?: boolean
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
// State Management Interfaces
|
|
1117
|
+
export interface PlayerState {
|
|
1118
|
+
guildId: string
|
|
1119
|
+
textChannel: string
|
|
1120
|
+
voiceChannel: string
|
|
1121
|
+
volume: number
|
|
1122
|
+
paused: boolean
|
|
1123
|
+
position: number
|
|
1124
|
+
current: Track | null
|
|
1125
|
+
queue: Track[]
|
|
1126
|
+
repeat: LoopMode
|
|
1127
|
+
shuffle: boolean
|
|
1128
|
+
deaf: boolean
|
|
1129
|
+
connected: boolean
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
export interface BrokenPlayerState extends PlayerState {
|
|
1133
|
+
originalNodeId: string
|
|
1134
|
+
brokenAt: number
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
export interface MigrationResult {
|
|
1138
|
+
success: boolean
|
|
1139
|
+
error?: any
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
export interface SavedPlayerData {
|
|
1143
|
+
g: string // guildId
|
|
1144
|
+
t: string // textChannel
|
|
1145
|
+
v: string // voiceChannel
|
|
1146
|
+
u: string | null // uri
|
|
1147
|
+
p: number // position
|
|
1148
|
+
ts: number // timestamp
|
|
1149
|
+
q: string[] // queue uris
|
|
1150
|
+
r: string | null // requester
|
|
1151
|
+
vol: number // volume
|
|
1152
|
+
pa: boolean // paused
|
|
1153
|
+
pl: boolean // playing
|
|
1154
|
+
nw: string | null // nowPlayingMessage id
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
export interface TrackResolutionOptions {
|
|
1158
|
+
platform?: SearchSource
|
|
1159
|
+
node?: Node
|
|
1160
|
+
toFront?: boolean
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
// Type Unions and Enums
|
|
1164
|
+
export type SearchSource =
|
|
1165
|
+
| 'ytsearch'
|
|
1166
|
+
| 'ytmsearch'
|
|
1167
|
+
| 'scsearch'
|
|
1168
|
+
| 'spsearch'
|
|
1169
|
+
| 'amsearch'
|
|
1170
|
+
| 'dzsearch'
|
|
1171
|
+
| 'yandexsearch'
|
|
1172
|
+
| 'soundcloud'
|
|
1173
|
+
| 'youtube'
|
|
1174
|
+
| 'spotify'
|
|
1175
|
+
| 'applemusic'
|
|
1176
|
+
| 'deezer'
|
|
1177
|
+
| 'bandcamp'
|
|
1178
|
+
| 'vimeo'
|
|
1179
|
+
| 'twitch'
|
|
1180
|
+
| 'http'
|
|
1181
|
+
|
|
1182
|
+
export type LoopMode = 0 | 1 | 2
|
|
1183
|
+
export type LoopModeName = 'none' | 'track' | 'queue'
|
|
1184
|
+
|
|
1185
|
+
export type LoadType =
|
|
1186
|
+
| 'track'
|
|
1187
|
+
| 'playlist'
|
|
1188
|
+
| 'search'
|
|
1189
|
+
| 'empty'
|
|
1190
|
+
| 'error'
|
|
1191
|
+
| 'LOAD_FAILED'
|
|
1192
|
+
| 'NO_MATCHES'
|
|
1193
|
+
|
|
1194
|
+
export type RestVersion = 'v3' | 'v4'
|
|
1195
|
+
|
|
1196
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'
|
|
1197
|
+
|
|
1198
|
+
export type LoadBalancerStrategy = 'leastLoad' | 'leastRest' | 'random'
|
|
1199
|
+
|
|
1200
|
+
export type EventHandler<T = any> = (...args: T[]) => void | Promise<void>
|
|
1201
|
+
|
|
1202
|
+
// Event Interfaces
|
|
1203
|
+
export interface AquaEvents {
|
|
1204
|
+
nodeConnect: (node: Node) => void
|
|
1205
|
+
nodeConnected: (node: Node) => void
|
|
1206
|
+
nodeDisconnect: (node: Node, data: { code: number; reason: string }) => void
|
|
1207
|
+
nodeError: (node: Node, error: Error) => void
|
|
1208
|
+
nodeReconnect: (node: Node, data: any) => void
|
|
1209
|
+
nodeCreate: (node: Node) => void
|
|
1210
|
+
nodeDestroy: (node: Node) => void
|
|
1211
|
+
nodeReady: (node: Node, data: any) => void
|
|
1212
|
+
nodeFailover: (node: Node) => void
|
|
1213
|
+
nodeFailoverComplete: (
|
|
1214
|
+
node: Node,
|
|
1215
|
+
successful: number,
|
|
1216
|
+
failed: number
|
|
1217
|
+
) => void
|
|
1218
|
+
playerCreate: (player: Player) => void
|
|
1219
|
+
playerDestroy: (player: Player) => void
|
|
1220
|
+
playerUpdate: (player: Player, packet: any) => void
|
|
1221
|
+
playerMigrated: (
|
|
1222
|
+
oldPlayer: Player,
|
|
1223
|
+
newPlayer: Player,
|
|
1224
|
+
targetNode: Node
|
|
1225
|
+
) => void
|
|
1226
|
+
playerReconnected: (player: Player, data: any) => void
|
|
1227
|
+
trackStart: (player: Player, track: Track) => void
|
|
1228
|
+
trackEnd: (player: Player, track: Track, reason?: string) => void
|
|
1229
|
+
trackError: (player: Player, track: Track, error: any) => void
|
|
1230
|
+
trackStuck: (player: Player, track: Track, thresholdMs: number) => void
|
|
1231
|
+
trackChange: (player: Player, track: Track, payload: any) => void
|
|
1232
|
+
queueEnd: (player: Player) => void
|
|
1233
|
+
playerMove: (oldChannel: string, newChannel: string) => void
|
|
1234
|
+
playersRebuilt: (node: Node, count: number) => void
|
|
1235
|
+
reconnectionFailed: (player: Player, data: any) => void
|
|
1236
|
+
socketClosed: (player: Player, payload: any) => void
|
|
1237
|
+
lyricsLine: (player: Player, track: Track, payload: any) => void
|
|
1238
|
+
lyricsFound: (player: Player, track: Track, payload: any) => void
|
|
1239
|
+
lyricsNotFound: (player: Player, track: Track, payload: any) => void
|
|
1240
|
+
autoplayFailed: (player: Player, error: Error) => void
|
|
1241
|
+
debug: (source: string, message: string) => void
|
|
1242
|
+
error: (node: Node | null, error: Error) => void
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
export interface PlayerEvents {
|
|
1246
|
+
destroy: () => void
|
|
1247
|
+
playerUpdate: (packet: any) => void
|
|
1248
|
+
event: (payload: any) => void
|
|
1249
|
+
trackStart: (track: Track) => void
|
|
1250
|
+
trackEnd: (track: Track, reason?: string) => void
|
|
1251
|
+
trackError: (track: Track, error: any) => void
|
|
1252
|
+
trackStuck: (track: Track, thresholdMs: number) => void
|
|
1253
|
+
trackChange: (track: Track, payload: any) => void
|
|
1254
|
+
socketClosed: (payload: any) => void
|
|
1255
|
+
lyricsLine: (track: Track, payload: any) => void
|
|
1256
|
+
lyricsFound: (track: Track, payload: any) => void
|
|
1257
|
+
lyricsNotFound: (track: Track, payload: any) => void
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
// Event Emitter Type Extensions for Aqua
|
|
1261
|
+
interface Aqua {
|
|
1262
|
+
on<K extends keyof AquaEvents>(event: K, listener: AquaEvents[K]): this
|
|
1263
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this
|
|
1264
|
+
|
|
1265
|
+
once<K extends keyof AquaEvents>(event: K, listener: AquaEvents[K]): this
|
|
1266
|
+
once(event: string | symbol, listener: (...args: any[]) => void): this
|
|
1267
|
+
|
|
1268
|
+
emit<K extends keyof AquaEvents>(
|
|
1269
|
+
event: K,
|
|
1270
|
+
...args: Parameters<AquaEvents[K]>
|
|
1271
|
+
): boolean
|
|
1272
|
+
emit(event: string | symbol, ...args: any[]): boolean
|
|
1273
|
+
|
|
1274
|
+
off<K extends keyof AquaEvents>(event: K, listener: AquaEvents[K]): this
|
|
1275
|
+
off(event: string | symbol, listener: (...args: any[]) => void): this
|
|
1276
|
+
|
|
1277
|
+
removeListener<K extends keyof AquaEvents>(
|
|
1278
|
+
event: K,
|
|
1279
|
+
listener: AquaEvents[K]
|
|
1280
|
+
): this
|
|
1281
|
+
removeListener(
|
|
1282
|
+
event: string | symbol,
|
|
1283
|
+
listener: (...args: any[]) => void
|
|
1284
|
+
): this
|
|
1285
|
+
|
|
1286
|
+
addListener<K extends keyof AquaEvents>(
|
|
1287
|
+
event: K,
|
|
1288
|
+
listener: AquaEvents[K]
|
|
1289
|
+
): this
|
|
1290
|
+
addListener(
|
|
1291
|
+
event: string | symbol,
|
|
1292
|
+
listener: (...args: any[]) => void
|
|
1293
|
+
): this
|
|
1294
|
+
|
|
1295
|
+
removeAllListeners<K extends keyof AquaEvents>(event?: K): this
|
|
1296
|
+
removeAllListeners(event?: string | symbol): this
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
interface Player {
|
|
1300
|
+
on<K extends keyof PlayerEvents>(event: K, listener: PlayerEvents[K]): this
|
|
1301
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this
|
|
1302
|
+
|
|
1303
|
+
once<K extends keyof PlayerEvents>(
|
|
1304
|
+
event: K,
|
|
1305
|
+
listener: PlayerEvents[K]
|
|
1306
|
+
): this
|
|
1307
|
+
once(event: string | symbol, listener: (...args: any[]) => void): this
|
|
1308
|
+
|
|
1309
|
+
emit<K extends keyof PlayerEvents>(
|
|
1310
|
+
event: K,
|
|
1311
|
+
...args: Parameters<PlayerEvents[K]>
|
|
1312
|
+
): boolean
|
|
1313
|
+
emit(event: string | symbol, ...args: any[]): boolean
|
|
1314
|
+
|
|
1315
|
+
off<K extends keyof PlayerEvents>(event: K, listener: PlayerEvents[K]): this
|
|
1316
|
+
off(event: string | symbol, listener: (...args: any[]) => void): this
|
|
1317
|
+
|
|
1318
|
+
removeListener<K extends keyof PlayerEvents>(
|
|
1319
|
+
event: K,
|
|
1320
|
+
listener: PlayerEvents[K]
|
|
1321
|
+
): this
|
|
1322
|
+
removeListener(
|
|
1323
|
+
event: string | symbol,
|
|
1324
|
+
listener: (...args: any[]) => void
|
|
1325
|
+
): this
|
|
1326
|
+
|
|
1327
|
+
addListener<K extends keyof PlayerEvents>(
|
|
1328
|
+
event: K,
|
|
1329
|
+
listener: PlayerEvents[K]
|
|
1330
|
+
): this
|
|
1331
|
+
addListener(
|
|
1332
|
+
event: string | symbol,
|
|
1333
|
+
listener: (...args: any[]) => void
|
|
1334
|
+
): this
|
|
1335
|
+
|
|
1336
|
+
removeAllListeners<K extends keyof PlayerEvents>(event?: K): this
|
|
1337
|
+
removeAllListeners(event?: string | symbol): this
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
// Additional Filter Preset Options
|
|
1341
|
+
export interface FilterPresetOptions {
|
|
1342
|
+
value?: number
|
|
1343
|
+
rate?: number
|
|
1344
|
+
pitch?: number
|
|
1345
|
+
rotationHz?: number
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
// Error Extensions
|
|
1349
|
+
export interface AquaError extends Error {
|
|
1350
|
+
statusCode?: number
|
|
1351
|
+
statusMessage?: string
|
|
1352
|
+
headers?: Record<string, string>
|
|
1353
|
+
body?: any
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
// Extended ResolveOptions for internal use
|
|
1357
|
+
export interface ExtendedResolveOptions extends ResolveOptions {
|
|
1358
|
+
node?: Node
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
// Export constants
|
|
1362
|
+
export const LOOP_MODES: {
|
|
1363
|
+
readonly NONE: 0
|
|
1364
|
+
readonly TRACK: 1
|
|
1365
|
+
readonly QUEUE: 2
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
export const AqualinkEvents: {
|
|
1369
|
+
readonly TrackStart: 'trackStart'
|
|
1370
|
+
readonly TrackEnd: 'trackEnd'
|
|
1371
|
+
readonly TrackError: 'trackError'
|
|
1372
|
+
readonly TrackStuck: 'trackStuck'
|
|
1373
|
+
readonly TrackChange: 'trackChange'
|
|
1374
|
+
readonly SocketClosed: 'socketClosed'
|
|
1375
|
+
readonly LyricsLine: 'lyricsLine'
|
|
1376
|
+
readonly LyricsFound: 'lyricsFound'
|
|
1377
|
+
readonly LyricsNotFound: 'lyricsNotFound'
|
|
1378
|
+
readonly QueueEnd: 'queueEnd'
|
|
1379
|
+
readonly PlayerUpdate: 'playerUpdate'
|
|
1380
|
+
readonly PlayerMove: 'playerMove'
|
|
1381
|
+
readonly PlayerReconnected: 'playerReconnected'
|
|
1382
|
+
readonly AutoplayFailed: 'autoplayFailed'
|
|
1383
|
+
readonly ReconnectionFailed: 'reconnectionFailed'
|
|
1384
|
+
readonly NodeConnect: 'nodeConnect'
|
|
1385
|
+
readonly NodeCreate: 'nodeCreate'
|
|
1386
|
+
readonly NodeError: 'nodeError'
|
|
1387
|
+
readonly NodeDisconnect: 'nodeDisconnect'
|
|
1388
|
+
readonly NodeReconnect: 'nodeReconnect'
|
|
1389
|
+
readonly NodeDestroy: 'nodeDestroy'
|
|
1390
|
+
readonly NodeReady: 'nodeReady'
|
|
1391
|
+
readonly NodeCustomOp: 'nodeCustomOp'
|
|
1392
|
+
readonly NodeFailover: 'nodeFailover'
|
|
1393
|
+
readonly NodeFailoverComplete: 'nodeFailoverComplete'
|
|
1394
|
+
readonly Debug: 'debug'
|
|
1395
|
+
readonly Error: 'error'
|
|
1396
|
+
readonly PlayerCreate: 'playerCreate'
|
|
1397
|
+
readonly PlayerDestroy: 'playerDestroy'
|
|
1398
|
+
readonly PlayersRebuilt: 'playersRebuilt'
|
|
1399
|
+
readonly PlayerMigrated: 'playerMigrated'
|
|
1400
|
+
}
|
|
1401
|
+
}
|