lavalink-client 2.6.3 → 2.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +352 -76
- package/dist/index.d.ts +352 -76
- package/dist/index.js +338 -146
- package/dist/index.mjs +338 -146
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -190,6 +190,9 @@ interface LavalinkFilterData extends FilterData {
|
|
|
190
190
|
equalizer?: EQBand[];
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
/**
|
|
194
|
+
* Debug events for more detailed logging
|
|
195
|
+
*/
|
|
193
196
|
declare enum DebugEvents {
|
|
194
197
|
SetSponsorBlock = "SetSponsorBlock",
|
|
195
198
|
DeleteSponsorBlock = "DeleteSponsorBlock",
|
|
@@ -232,6 +235,9 @@ declare enum DebugEvents {
|
|
|
232
235
|
NoAudioDebug = "NoAudioDebug",
|
|
233
236
|
PlayerAutoReconnect = "PlayerAutoReconnect"
|
|
234
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* Reasons why a player got destroyed
|
|
240
|
+
*/
|
|
235
241
|
declare enum DestroyReasons {
|
|
236
242
|
QueueEmpty = "QueueEmpty",
|
|
237
243
|
NodeDestroy = "NodeDestroy",
|
|
@@ -248,13 +254,18 @@ declare enum DestroyReasons {
|
|
|
248
254
|
TrackErrorMaxTracksErroredPerTime = "TrackErrorMaxTracksErroredPerTime",
|
|
249
255
|
TrackStuckMaxTracksErroredPerTime = "TrackStuckMaxTracksErroredPerTime"
|
|
250
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* Reasons why a player got disconnected
|
|
259
|
+
*/
|
|
251
260
|
declare enum DisconnectReasons {
|
|
252
261
|
Disconnected = "Disconnected",
|
|
253
262
|
DisconnectAllNodes = "DisconnectAllNodes"
|
|
254
263
|
}
|
|
264
|
+
/** The valid SponsorBlock categories */
|
|
255
265
|
declare const validSponsorBlocks: string[];
|
|
256
266
|
/** The audio Outputs Data map declaration */
|
|
257
267
|
declare const audioOutputsData: Record<AudioOutputs, ChannelMixFilter>;
|
|
268
|
+
/** Equalizer Presets */
|
|
258
269
|
declare const EQList: {
|
|
259
270
|
/** A Bassboost Equalizer, so high it distorts the audio */
|
|
260
271
|
BassboostEarrape: EQBand[];
|
|
@@ -281,6 +292,19 @@ declare const EQList: {
|
|
|
281
292
|
};
|
|
282
293
|
|
|
283
294
|
declare class FilterManager {
|
|
295
|
+
static EQList: {
|
|
296
|
+
BassboostEarrape: EQBand[];
|
|
297
|
+
BassboostHigh: EQBand[];
|
|
298
|
+
BassboostMedium: EQBand[];
|
|
299
|
+
BassboostLow: EQBand[];
|
|
300
|
+
BetterMusic: EQBand[];
|
|
301
|
+
Rock: EQBand[];
|
|
302
|
+
Classic: EQBand[];
|
|
303
|
+
Pop: EQBand[];
|
|
304
|
+
Electronic: EQBand[];
|
|
305
|
+
FullSound: EQBand[];
|
|
306
|
+
Gaming: EQBand[];
|
|
307
|
+
};
|
|
284
308
|
/** The Equalizer bands currently applied to the Lavalink Server */
|
|
285
309
|
equalizerBands: EQBand[];
|
|
286
310
|
/** Private Util for the instaFix Filters option */
|
|
@@ -295,153 +319,387 @@ declare class FilterManager {
|
|
|
295
319
|
constructor(player: Player);
|
|
296
320
|
/**
|
|
297
321
|
* Apply Player filters for lavalink filter sending data, if the filter is enabled / not
|
|
322
|
+
*
|
|
323
|
+
* @returns {Promise<void>}
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* ```ts
|
|
327
|
+
* // Apply the filters after changing them manually:
|
|
328
|
+
* player.filterManager.data.volume = 0.5;
|
|
329
|
+
* // maybe you wanna manually set a distorition filter? then do it like this...
|
|
330
|
+
* player.filterManager.data.distortion = { sinOffset: 0.5, sinScale: 2, cosOffset: 0.5, cosScale: 2, tanOffset: 0.5, tanScale: 2, offset: 0.5, scale: 2 };
|
|
331
|
+
* await player.filterManager.applyPlayerFilters();
|
|
332
|
+
* ```
|
|
298
333
|
*/
|
|
299
334
|
applyPlayerFilters(): Promise<void>;
|
|
300
335
|
/**
|
|
301
|
-
* Checks if the filters are correctly stated (active / not-active)
|
|
336
|
+
* Checks if the filters are correctly stated (active / not-active) - mostly used internally.
|
|
302
337
|
* @param oldFilterTimescale
|
|
303
|
-
* @returns
|
|
338
|
+
* @returns {boolean} True, if the check was successfull
|
|
339
|
+
*
|
|
340
|
+
* @example
|
|
341
|
+
* ```ts
|
|
342
|
+
* // Check the filter states
|
|
343
|
+
* player.filterManager.checkFiltersState();
|
|
344
|
+
* // Apply the filters after checking
|
|
345
|
+
* await player.filterManager.applyPlayerFilters();
|
|
346
|
+
* ```
|
|
304
347
|
*/
|
|
305
348
|
checkFiltersState(oldFilterTimescale?: Partial<TimescaleFilter>): boolean;
|
|
306
349
|
/**
|
|
307
350
|
* Reset all Filters
|
|
351
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
352
|
+
*
|
|
353
|
+
* @example
|
|
354
|
+
* ```ts
|
|
355
|
+
* // Reset all filters
|
|
356
|
+
* await player.filterManager.resetFilters();
|
|
357
|
+
* ```
|
|
308
358
|
*/
|
|
309
|
-
resetFilters(): Promise<
|
|
359
|
+
resetFilters(): Promise<FilterManager>;
|
|
310
360
|
/**
|
|
311
361
|
* Set the Filter Volume
|
|
312
|
-
* @param volume
|
|
313
|
-
* @returns
|
|
362
|
+
* @param volume the volume (0.0 - 5.0)
|
|
363
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
364
|
+
*
|
|
365
|
+
* @example
|
|
366
|
+
* ```ts
|
|
367
|
+
* // Set Volume to 50%
|
|
368
|
+
* await player.filterManager.setVolume(0.5);
|
|
369
|
+
* // note this is a filter, so it will "jump" to the volume, i think it's like a "volume boost effect" so i marketed it as a filter
|
|
370
|
+
* ```
|
|
314
371
|
*/
|
|
315
|
-
setVolume(volume: number): Promise<
|
|
372
|
+
setVolume(volume: number): Promise<this>;
|
|
316
373
|
/**
|
|
317
374
|
* Set the AudioOutput Filter
|
|
318
|
-
* @param type
|
|
319
|
-
* @returns
|
|
375
|
+
* @param {AudioOutputs} type the audio output type
|
|
376
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
* ```ts
|
|
380
|
+
* // Set Audio Output to Mono
|
|
381
|
+
* await player.filterManager.setAudioOutput("mono");
|
|
382
|
+
*
|
|
383
|
+
* // Set Audio Output to Stereo
|
|
384
|
+
* await player.filterManager.setAudioOutput("stereo");
|
|
385
|
+
*
|
|
386
|
+
* // Set Audio Output to Left
|
|
387
|
+
* await player.filterManager.setAudioOutput("left");
|
|
388
|
+
*
|
|
389
|
+
* // Set Audio Output to Right
|
|
390
|
+
* await player.filterManager.setAudioOutput("right");
|
|
391
|
+
* ```
|
|
320
392
|
*/
|
|
321
|
-
setAudioOutput(type: AudioOutputs): Promise<
|
|
393
|
+
setAudioOutput(type: AudioOutputs): Promise<FilterManager>;
|
|
322
394
|
/**
|
|
323
395
|
* Set custom filter.timescale#speed . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
324
|
-
* @param speed
|
|
325
|
-
* @returns
|
|
396
|
+
* @param {number} speed set the speed of the filter
|
|
397
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
* ```ts
|
|
401
|
+
* // Set Speed to 1.25 (disableds nightcore and vaporwave effect which are pre-made timescale settings of rate,pitch and speed)
|
|
402
|
+
* await player.filterManager.setSpeed(1.25);
|
|
403
|
+
* ```
|
|
326
404
|
*/
|
|
327
|
-
setSpeed(speed?: number): Promise<
|
|
405
|
+
setSpeed(speed?: number): Promise<FilterManager>;
|
|
328
406
|
/**
|
|
329
407
|
* Set custom filter.timescale#pitch . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
330
|
-
* @param
|
|
331
|
-
* @returns
|
|
408
|
+
* @param {number} pitch set the pitch of the filter
|
|
409
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* ```ts
|
|
413
|
+
* // Set Pitch to 1.25 (disableds nightcore and vaporwave effect which are pre-made timescale settings of rate,pitch and speed)
|
|
414
|
+
* await player.filterManager.setPitch(1.25);
|
|
415
|
+
* ```
|
|
332
416
|
*/
|
|
333
|
-
setPitch(pitch?: number): Promise<
|
|
417
|
+
setPitch(pitch?: number): Promise<FilterManager>;
|
|
334
418
|
/**
|
|
335
419
|
* Set custom filter.timescale#rate . This method disabled both: nightcore & vaporwave. use 1 to reset it to normal
|
|
336
|
-
* @param
|
|
337
|
-
* @returns
|
|
420
|
+
* @param {number} rate set the rate of the filter
|
|
421
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* ```ts
|
|
425
|
+
* // Set Rate to 1.25 (disableds nightcore and vaporwave effect which are pre-made timescale settings of rate,pitch and speed)
|
|
426
|
+
* await player.filterManager.setRate(1.25);
|
|
427
|
+
* ```
|
|
338
428
|
*/
|
|
339
|
-
setRate(rate?: number): Promise<
|
|
429
|
+
setRate(rate?: number): Promise<FilterManager>;
|
|
340
430
|
/**
|
|
341
431
|
* Enables / Disables the rotation effect, (Optional: provide your Own Data)
|
|
342
|
-
* @param rotationHz
|
|
343
|
-
* @returns
|
|
432
|
+
* @param {number} rotationHz set the rotationHz of the filter
|
|
433
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
434
|
+
*
|
|
435
|
+
* @example
|
|
436
|
+
* ```ts
|
|
437
|
+
* // Toggle Rotation filter with custom settings
|
|
438
|
+
* await player.filterManager.toggleRotation(0.4);
|
|
439
|
+
* // or use the defaults
|
|
440
|
+
* await player.filterManager.toggleRotation();
|
|
441
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
442
|
+
* ```
|
|
344
443
|
*/
|
|
345
|
-
toggleRotation(rotationHz?: number): Promise<
|
|
444
|
+
toggleRotation(rotationHz?: number): Promise<FilterManager>;
|
|
346
445
|
/**
|
|
347
446
|
* Enables / Disables the Vibrato effect, (Optional: provide your Own Data)
|
|
348
|
-
* @param frequency
|
|
349
|
-
* @param depth
|
|
350
|
-
* @returns
|
|
447
|
+
* @param {number} frequency set the frequency of the filter
|
|
448
|
+
* @param {number} depth set the depth of the filter
|
|
449
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
450
|
+
*
|
|
451
|
+
* @example
|
|
452
|
+
* ```ts
|
|
453
|
+
* // Toggle Vibrato filter with custom settings
|
|
454
|
+
* await player.filterManager.toggleVibrato(8, 0.5);
|
|
455
|
+
* // or use the defaults
|
|
456
|
+
* await player.filterManager.toggleVibrato();
|
|
457
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
458
|
+
* ```
|
|
351
459
|
*/
|
|
352
|
-
toggleVibrato(frequency?: number, depth?: number): Promise<
|
|
460
|
+
toggleVibrato(frequency?: number, depth?: number): Promise<FilterManager>;
|
|
353
461
|
/**
|
|
354
462
|
* Enables / Disables the Tremolo effect, (Optional: provide your Own Data)
|
|
355
|
-
* @param frequency
|
|
356
|
-
* @param depth
|
|
357
|
-
* @returns
|
|
463
|
+
* @param {number} frequency set the frequency of the filter
|
|
464
|
+
* @param {number} depth set the depth of the filter
|
|
465
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
466
|
+
*
|
|
467
|
+
* @example
|
|
468
|
+
* ```ts
|
|
469
|
+
* // Toggle Tremolo filter with custom settings
|
|
470
|
+
* await player.filterManager.toggleTremolo(5, 0.7);
|
|
471
|
+
* // or use the defaults
|
|
472
|
+
* await player.filterManager.toggleTremolo();
|
|
473
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
474
|
+
* ```
|
|
358
475
|
*/
|
|
359
|
-
toggleTremolo(frequency?: number, depth?: number): Promise<
|
|
476
|
+
toggleTremolo(frequency?: number, depth?: number): Promise<FilterManager>;
|
|
360
477
|
/**
|
|
361
478
|
* Enables / Disables the LowPass effect, (Optional: provide your Own Data)
|
|
362
|
-
* @param smoothing
|
|
363
|
-
* @returns
|
|
479
|
+
* @param {number} smoothing set the smoothing of the filter
|
|
480
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
481
|
+
*
|
|
482
|
+
* @example
|
|
483
|
+
* ```ts
|
|
484
|
+
* // Toggle LowPass filter with custom settings
|
|
485
|
+
* await player.filterManager.toggleLowPass(30);
|
|
486
|
+
* // or use the defaults
|
|
487
|
+
* await player.filterManager.toggleLowPass();
|
|
488
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
489
|
+
* ```
|
|
490
|
+
*/
|
|
491
|
+
toggleLowPass(smoothing?: number): Promise<FilterManager>;
|
|
492
|
+
/**
|
|
493
|
+
* Lavalink LavaDspx Plugin Filters
|
|
364
494
|
*/
|
|
365
|
-
toggleLowPass(smoothing?: number): Promise<boolean>;
|
|
366
495
|
lavalinkLavaDspxPlugin: {
|
|
367
496
|
/**
|
|
368
497
|
* Enables / Disables the LowPass effect, (Optional: provide your Own Data)
|
|
369
|
-
* @param boostFactor
|
|
370
|
-
* @param cutoffFrequency
|
|
371
|
-
* @returns
|
|
498
|
+
* @param {number} boostFactor set the boost factor of the filter
|
|
499
|
+
* @param {number} cutoffFrequency set the cutoff frequency of the filter
|
|
500
|
+
* @returns {Promise<boolean>} the state of the filter after execution.
|
|
501
|
+
*
|
|
502
|
+
* @example
|
|
503
|
+
* ```ts
|
|
504
|
+
* // Toggle LowPass filter with custom settings
|
|
505
|
+
* await player.filterManager.lavalinkLavaDspxPlugin.toggleLowPass(1.2, 300);
|
|
506
|
+
* // or use the defaults
|
|
507
|
+
* await player.filterManager.lavalinkLavaDspxPlugin.toggleLowPass();
|
|
508
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
509
|
+
* ```
|
|
372
510
|
*/
|
|
373
|
-
toggleLowPass: (boostFactor?: number, cutoffFrequency?: number) => Promise<
|
|
511
|
+
toggleLowPass: (boostFactor?: number, cutoffFrequency?: number) => Promise<FilterManager>;
|
|
374
512
|
/**
|
|
375
513
|
* Enables / Disables the HighPass effect, (Optional: provide your Own Data)
|
|
376
|
-
* @param boostFactor
|
|
377
|
-
* @param cutoffFrequency
|
|
378
|
-
* @returns
|
|
514
|
+
* @param {number} boostFactor [] set the boost factor of the filter
|
|
515
|
+
* @param {number} cutoffFrequency set the cutoff frequency of the filter
|
|
516
|
+
* @returns {Promise<boolean>} the state of the filter after execution.
|
|
517
|
+
*
|
|
518
|
+
* @example
|
|
519
|
+
* ```ts
|
|
520
|
+
* // Toggle HighPass filter with custom settings
|
|
521
|
+
* await player.filterManager.lavalinkLavaDspxPlugin.toggleHighPass(1.2, 150); // custom values
|
|
522
|
+
* // or use the defaults
|
|
523
|
+
* await player.filterManager.lavalinkLavaDspxPlugin.toggleHighPass();
|
|
524
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
525
|
+
* ```
|
|
379
526
|
*/
|
|
380
|
-
toggleHighPass: (boostFactor?: number, cutoffFrequency?: number) => Promise<
|
|
527
|
+
toggleHighPass: (boostFactor?: number, cutoffFrequency?: number) => Promise<FilterManager>;
|
|
381
528
|
/**
|
|
382
529
|
* Enables / Disables the Normalization effect.
|
|
383
530
|
* @param {number} [maxAmplitude=0.75] - The maximum amplitude of the audio.
|
|
384
|
-
* @param {boolean} [adaptive=true]
|
|
385
|
-
* @returns {Promise<
|
|
531
|
+
* @param {boolean} [adaptive=true] Whether to use adaptive normalization or not.
|
|
532
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
533
|
+
*
|
|
534
|
+
* @example
|
|
535
|
+
* ```ts
|
|
536
|
+
* // Toggle Normalization filter with custom settings
|
|
537
|
+
* await player.filterManager.lavalinkLavaDspxPlugin.toggleNormalization(0.9, false); // custom values
|
|
538
|
+
* // or use the defaults
|
|
539
|
+
* await player.filterManager.lavalinkLavaDspxPlugin.toggleNormalization();
|
|
540
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
541
|
+
* ```
|
|
386
542
|
*/
|
|
387
|
-
toggleNormalization: (maxAmplitude?: number, adaptive?: boolean) => Promise<
|
|
543
|
+
toggleNormalization: (maxAmplitude?: number, adaptive?: boolean) => Promise<FilterManager>;
|
|
388
544
|
/**
|
|
389
545
|
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
|
|
390
|
-
* @param {number} [decay=0.5]
|
|
391
|
-
* @param {number} [echoLength=0.5]
|
|
392
|
-
* @returns {Promise<
|
|
546
|
+
* @param {number} [decay=0.5] The decay of the echo effect.
|
|
547
|
+
* @param {number} [echoLength=0.5] The length of the echo effect.
|
|
548
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
549
|
+
*
|
|
550
|
+
* @example
|
|
551
|
+
* ```ts
|
|
552
|
+
* // Toggle Echo filter with custom settings
|
|
553
|
+
* await player.filterManager.lavalinkLavaDspxPlugin.toggleEcho(0.7, 0.6); // custom values
|
|
554
|
+
* // or use the defaults
|
|
555
|
+
* await player.filterManager.lavalinkLavaDspxPlugin.toggleEcho();
|
|
556
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
557
|
+
* ```
|
|
393
558
|
*/
|
|
394
|
-
toggleEcho: (decay?: number, echoLength?: number) => Promise<
|
|
559
|
+
toggleEcho: (decay?: number, echoLength?: number) => Promise<FilterManager>;
|
|
395
560
|
};
|
|
561
|
+
/**
|
|
562
|
+
* LavalinkFilter Plugin specific Filters
|
|
563
|
+
*/
|
|
396
564
|
lavalinkFilterPlugin: {
|
|
397
565
|
/**
|
|
398
566
|
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
|
|
399
|
-
* @param delay
|
|
400
|
-
* @param decay
|
|
401
|
-
* @returns
|
|
567
|
+
* @param {number} delay set the delay of the echo
|
|
568
|
+
* @param {number} decay set the decay of the echo
|
|
569
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
570
|
+
*
|
|
571
|
+
* @example
|
|
572
|
+
* ```ts
|
|
573
|
+
* // Toggle Echo filter with custom settings
|
|
574
|
+
* await player.filterManager.lavalinkFilterPlugin.toggleEcho(3, 0.7); // custom values
|
|
575
|
+
* // or use the defaults
|
|
576
|
+
* await player.filterManager.lavalinkFilterPlugin.toggleEcho();
|
|
577
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
578
|
+
* ```
|
|
402
579
|
*/
|
|
403
|
-
toggleEcho: (delay?: number, decay?: number) => Promise<
|
|
580
|
+
toggleEcho: (delay?: number, decay?: number) => Promise<FilterManager>;
|
|
404
581
|
/**
|
|
405
582
|
* Enables / Disables the Echo effect, IMPORTANT! Only works with the correct Lavalink Plugin installed. (Optional: provide your Own Data)
|
|
406
|
-
* @param delays
|
|
407
|
-
* @param gains
|
|
408
|
-
* @returns
|
|
583
|
+
* @param {number} delays set the delays of the reverb
|
|
584
|
+
* @param {number} gains set the gains of the reverb
|
|
585
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
586
|
+
*
|
|
587
|
+
* @example
|
|
588
|
+
* ```ts
|
|
589
|
+
* // Toggle Reverb filter with custom settings
|
|
590
|
+
* await player.filterManager.lavalinkFilterPlugin.toggleReverb([0.04, 0.045, 0.05, 0.055], [0.85, 0.84, 0.83, 0.82]);
|
|
591
|
+
* // or use the defaults
|
|
592
|
+
* await player.filterManager.lavalinkFilterPlugin.toggleReverb();
|
|
593
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
594
|
+
* ```
|
|
409
595
|
*/
|
|
410
|
-
toggleReverb: (delays?: number[], gains?: number[]) => Promise<
|
|
596
|
+
toggleReverb: (delays?: number[], gains?: number[]) => Promise<FilterManager>;
|
|
411
597
|
};
|
|
412
598
|
/**
|
|
413
599
|
* Enables / Disables a Nightcore-like filter Effect. Disables/Overrides both: custom and Vaporwave Filter
|
|
414
|
-
* @param speed
|
|
415
|
-
* @param pitch
|
|
416
|
-
* @param rate
|
|
417
|
-
* @returns
|
|
600
|
+
* @param {number} speed set the speed of the filter
|
|
601
|
+
* @param {number} pitch set the pitch of the filter
|
|
602
|
+
* @param {number} rate set the rate of the filter
|
|
603
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
604
|
+
*
|
|
605
|
+
* @example
|
|
606
|
+
* ```ts
|
|
607
|
+
* // Toggle Nightcore filter with custom settings
|
|
608
|
+
* await player.filterManager.toggleNightcore(1.3, 1.3, 0.9);
|
|
609
|
+
* // or use the defaults
|
|
610
|
+
* await player.filterManager.toggleNightcore();
|
|
611
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
612
|
+
* ```
|
|
418
613
|
*/
|
|
419
|
-
toggleNightcore(speed?: number, pitch?: number, rate?: number): Promise<
|
|
614
|
+
toggleNightcore(speed?: number, pitch?: number, rate?: number): Promise<FilterManager>;
|
|
420
615
|
/**
|
|
421
616
|
* Enables / Disables a Vaporwave-like filter Effect. Disables/Overrides both: custom and nightcore Filter
|
|
422
|
-
* @param speed
|
|
423
|
-
* @param pitch
|
|
424
|
-
* @param rate
|
|
425
|
-
* @returns
|
|
617
|
+
* @param {number} speed set the speed of the filterq
|
|
618
|
+
* @param {number} pitch set the pitch of the filter
|
|
619
|
+
* @param {number} rate set the rate of the filter
|
|
620
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
621
|
+
*
|
|
622
|
+
* @example
|
|
623
|
+
* ```ts
|
|
624
|
+
* // Toggle Vaporwave filter with custom settings
|
|
625
|
+
* await player.filterManager.toggleVaporwave(0.9, 0.7, 1);
|
|
626
|
+
* // or use the defaults
|
|
627
|
+
* await player.filterManager.toggleVaporwave();
|
|
628
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
629
|
+
* ```
|
|
426
630
|
*/
|
|
427
|
-
toggleVaporwave(speed?: number, pitch?: number, rate?: number): Promise<
|
|
631
|
+
toggleVaporwave(speed?: number, pitch?: number, rate?: number): Promise<FilterManager>;
|
|
428
632
|
/**
|
|
429
633
|
* Enable / Disables a Karaoke like Filter Effect
|
|
430
|
-
* @param level
|
|
431
|
-
* @param monoLevel
|
|
432
|
-
* @param filterBand
|
|
433
|
-
* @param filterWidth
|
|
434
|
-
* @returns
|
|
634
|
+
* @param {number} level set the level of the filter
|
|
635
|
+
* @param {number} monoLevel set the mono level of the filter
|
|
636
|
+
* @param {number} filterBand set the filter band of the filter
|
|
637
|
+
* @param {number} filterWidth set the filter width of the filter
|
|
638
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
639
|
+
*
|
|
640
|
+
* @example
|
|
641
|
+
* ```ts
|
|
642
|
+
* // Toggle Karaoke filter with custom settings
|
|
643
|
+
* await player.filterManager.toggleKaraoke(1.5, 1.0, 220, 100);
|
|
644
|
+
* // or use the defaults
|
|
645
|
+
* await player.filterManager.toggleKaraoke();
|
|
646
|
+
* // when it's enabled before calling the toggle function, it disables it, so you might need to do some if/else logic.
|
|
647
|
+
* ```
|
|
648
|
+
*/
|
|
649
|
+
toggleKaraoke(level?: number, monoLevel?: number, filterBand?: number, filterWidth?: number): Promise<FilterManager>;
|
|
650
|
+
/**
|
|
651
|
+
* Function to find out if currently there is a custom timescamle etc. filter applied
|
|
652
|
+
* @returns {boolean} whether a custom filter is active
|
|
653
|
+
*
|
|
654
|
+
* @example
|
|
655
|
+
* ```ts
|
|
656
|
+
* // Check if a custom filter is active
|
|
657
|
+
* const isCustom = player.filterManager.isCustomFilterActive();
|
|
658
|
+
* console.log(`Is custom filter active? ${isCustom}`);
|
|
659
|
+
* ```
|
|
435
660
|
*/
|
|
436
|
-
toggleKaraoke(level?: number, monoLevel?: number, filterBand?: number, filterWidth?: number): Promise<boolean>;
|
|
437
|
-
/** Function to find out if currently there is a custom timescamle etc. filter applied */
|
|
438
661
|
isCustomFilterActive(): boolean;
|
|
439
662
|
/**
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
663
|
+
* Sets the players equalizer bands using one of the predefined presets.
|
|
664
|
+
* @param {keyof typeof EQList} preset The preset to use.
|
|
665
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
666
|
+
*
|
|
667
|
+
* @example
|
|
668
|
+
* ```ts
|
|
669
|
+
* // Set EQ preset
|
|
670
|
+
* await player.filterManager.setEQPreset('BassboostMedium');
|
|
671
|
+
* ```
|
|
672
|
+
*/
|
|
673
|
+
setEQPreset(preset: keyof typeof EQList): Promise<this>;
|
|
674
|
+
/**
|
|
675
|
+
* Sets the players equalizer band on-top of the existing ones.
|
|
676
|
+
* @param {number} bands
|
|
677
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
678
|
+
*
|
|
679
|
+
* @example
|
|
680
|
+
* ```ts
|
|
681
|
+
* // Set EQ bands
|
|
682
|
+
* await player.filterManager.setEQ([
|
|
683
|
+
* { band: 0, gain: 0.3 },
|
|
684
|
+
* { band: 1, gain: -0.2 },
|
|
685
|
+
* { band: 2, gain: 0.1 }
|
|
686
|
+
* ]);
|
|
687
|
+
*
|
|
688
|
+
* // or use one of the templates:
|
|
689
|
+
* await player.filterManager.setEQ(player.filterManager.EQList.BassboostMedium); // you can also import EQList from somewhere package if wanted.
|
|
690
|
+
* ```
|
|
691
|
+
*/
|
|
443
692
|
setEQ(bands: EQBand | EQBand[]): Promise<this>;
|
|
444
|
-
/**
|
|
693
|
+
/**
|
|
694
|
+
* Clears the equalizer bands.
|
|
695
|
+
* @returns {Promise<FilterManager>} The Filter Manager, for chaining.
|
|
696
|
+
*
|
|
697
|
+
* @example
|
|
698
|
+
* ```ts
|
|
699
|
+
* // Clear all EQ bands
|
|
700
|
+
* await player.filterManager.clearEQ();
|
|
701
|
+
* ```
|
|
702
|
+
*/
|
|
445
703
|
clearEQ(): Promise<this>;
|
|
446
704
|
}
|
|
447
705
|
|
|
@@ -1404,6 +1662,24 @@ declare class ManagerUtils {
|
|
|
1404
1662
|
* @param data
|
|
1405
1663
|
*/
|
|
1406
1664
|
isNodeOptions(data: LavalinkNodeOptions): boolean;
|
|
1665
|
+
/**
|
|
1666
|
+
* Validate tracks based on duration wether they are playble or broken tracks.
|
|
1667
|
+
* most tracks should be longer than 30s, so you can put a minDuration of 29e3 (cause preview tracks are exactly 30s) or put 0.
|
|
1668
|
+
* This check is not done automatically, you need to check it yourself by doing:
|
|
1669
|
+
* @example
|
|
1670
|
+
* ```ts
|
|
1671
|
+
* const tracks = await player.search("Adele");
|
|
1672
|
+
*
|
|
1673
|
+
* // short hand:
|
|
1674
|
+
* const validTracks = tracks.filter(client.lavalink.utils.isNotBrokenTrack)
|
|
1675
|
+
* // or with options:
|
|
1676
|
+
* const vaildTracks = tracks.filter(t => client.lavalink.utils.isNotBrokenTrack(t, 29e3));
|
|
1677
|
+
*
|
|
1678
|
+
* // then you can add it to the queue.
|
|
1679
|
+
* await player.queue.add(validTracks);
|
|
1680
|
+
* ```
|
|
1681
|
+
*/
|
|
1682
|
+
isNotBrokenTrack(data: Track, minDuration?: number): data is Track;
|
|
1407
1683
|
/**
|
|
1408
1684
|
* Validate if a data is equal to a track
|
|
1409
1685
|
* @param data the Track to validate
|