lavalink-client 2.7.7 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -1
- package/dist/index.d.mts +232 -32
- package/dist/index.d.ts +232 -32
- package/dist/index.js +245 -19
- package/dist/index.mjs +245 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
- ✨ **Flexible Queue Stores:** Use the default in-memory store or bring your own (Redis, databases, etc.) to sync queues across multiple processes.
|
|
33
33
|
- 🎶 **Unresolved Tracks:** Supports unresolved track objects, fetching full data only when a track is about to play, saving API requests and resources.
|
|
34
34
|
- 🎚️ **Built-in Filters & EQ:** Easy-to-use management for audio filters and equalizers.
|
|
35
|
+
- 🔍 **Advanced Queue Filtering:** Search and filter tracks in the queue by title, author, duration, and more with powerful query options.
|
|
35
36
|
- ⚙️ **Advanced Player Options:** Fine-tune player behavior for disconnects, empty queues, volume handling, and more.
|
|
36
37
|
- 🛡️ **Lavalink-Side Validation:** Ensures you only use filters, plugins, and sources that your Lavalink node actually supports.
|
|
37
38
|
- 🔒 **Client-Side Validation:** Whitelist and blacklist URLs or domains to prevent unwanted requests and protect your bot.
|
|
@@ -105,6 +106,55 @@ pnpm add tomato6966/lavalink-client
|
|
|
105
106
|
|
|
106
107
|
***
|
|
107
108
|
|
|
109
|
+
# Node Link
|
|
110
|
+
|
|
111
|
+
This client can be used with nodelink too, but because nodelink's websocket is different than the one from lavalink, you need to disable a few things on the NODE OPTIONS / NODE PROPERTIES:
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
nodeOptions.heartBeatInterval = -1
|
|
115
|
+
nodeOptions.enablePingOnStatsCheck = false
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
this can be done directly when creating the node in the lavalinkmanager.
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
client.lavalink = new LavalinkManager({
|
|
122
|
+
nodes: [
|
|
123
|
+
{
|
|
124
|
+
host: "localhost",
|
|
125
|
+
|
|
126
|
+
heartBeatInterval: -1,
|
|
127
|
+
enablePingOnStatsCheck: false,
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
})
|
|
131
|
+
client.lavalink = new LavalinkManager({
|
|
132
|
+
nodes: [
|
|
133
|
+
{
|
|
134
|
+
authorization: "youshallnotpass", // The password for your Lavalink server
|
|
135
|
+
host: "localhost",
|
|
136
|
+
port: 2333,
|
|
137
|
+
id: "Main Node",
|
|
138
|
+
// DISABLE HEARTBEAT CHECKS AND regular PING CHECKS IN ORDER TO HAVE A STABLE CONNECTION TO NODELINK
|
|
139
|
+
heartBeatInterval: -1,
|
|
140
|
+
enablePingOnStatsCheck: false,
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
// A function to send voice server updates to the Lavalink client
|
|
144
|
+
sendToShard: (guildId, payload) => {
|
|
145
|
+
const guild = client.guilds.cache.get(guildId);
|
|
146
|
+
if (guild) guild.shard.send(payload);
|
|
147
|
+
},
|
|
148
|
+
autoSkip: true,
|
|
149
|
+
client: {
|
|
150
|
+
id: process.env.CLIENT_ID, // Your bot's user ID
|
|
151
|
+
username: "MyBot",
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
***
|
|
157
|
+
|
|
108
158
|
## 💖 Used In
|
|
109
159
|
This client powers various Discord bots:
|
|
110
160
|
- **[Mivator](https://discord.gg/5dUb7M2qCj)** (Public Bot by @Tomato6966)
|
|
@@ -117,12 +167,13 @@ This client powers various Discord bots:
|
|
|
117
167
|
- [Akyn](https://akynbot.vercel.app/) (@notdeltaxd)
|
|
118
168
|
- [ARINO](https://site.arinoapp.qzz.io/) (@ryanwtf88)
|
|
119
169
|
- [iHorizon](https://github.com/ihrz/ihrz) (@iHorizon)
|
|
120
|
-
- **Bots Community (Users):**
|
|
170
|
+
- **Bots By Community (Users):**
|
|
121
171
|
- [Soundy](https://github.com/idMJA/Soundy) (@idMJA)
|
|
122
172
|
- [BeatBot](https://getbeatbot.vercel.app/) (@zenitsujs)
|
|
123
173
|
- [Atom Music](https://top.gg/bot/1320469557411971165) (@sakshamyep)
|
|
124
174
|
- [All Time Bot](https://top.gg/bot/1163027457671180418) (@PeterGamez)
|
|
125
175
|
- [BeatDock](https://github.com/lazaroagomez/BeatDock) (@lazaroagomez)
|
|
176
|
+
- [Nazha](https://top.gg/bot/1124681788070055967) (@Nazha-Team)
|
|
126
177
|
|
|
127
178
|
***
|
|
128
179
|
|
|
@@ -463,3 +514,5 @@ if (response.tracks.length > 0) {
|
|
|
463
514
|
</details>
|
|
464
515
|
|
|
465
516
|
</div>
|
|
517
|
+
|
|
518
|
+
|
package/dist/index.d.mts
CHANGED
|
@@ -26,11 +26,11 @@ declare class FilterManager {
|
|
|
26
26
|
player: Player;
|
|
27
27
|
private get _LManager();
|
|
28
28
|
/**
|
|
29
|
-
* Returns
|
|
29
|
+
* Returns whether the plugin validations are enabled or not
|
|
30
30
|
*/
|
|
31
31
|
private get _checkForPlugins();
|
|
32
32
|
/**
|
|
33
|
-
* Returns
|
|
33
|
+
* Returns whether the source validations are enabled or not
|
|
34
34
|
*/
|
|
35
35
|
private get _checkForSources();
|
|
36
36
|
/** The Constructor for the FilterManager */
|
|
@@ -446,9 +446,9 @@ interface LavalinkTrackInfo {
|
|
|
446
446
|
uri: string;
|
|
447
447
|
/** The Source name of the Track, e.g. soundcloud, youtube, spotify */
|
|
448
448
|
sourceName: SourceNames;
|
|
449
|
-
/**
|
|
449
|
+
/** Whether the audio is seekable */
|
|
450
450
|
isSeekable: boolean;
|
|
451
|
-
/**
|
|
451
|
+
/** Whether the audio is of a live stream */
|
|
452
452
|
isStream: boolean;
|
|
453
453
|
/** If isrc code is available, it's provided */
|
|
454
454
|
isrc: string | null;
|
|
@@ -468,9 +468,9 @@ interface TrackInfo {
|
|
|
468
468
|
uri: string;
|
|
469
469
|
/** The Source name of the Track, e.g. soundcloud, youtube, spotify */
|
|
470
470
|
sourceName: SourceNames;
|
|
471
|
-
/**
|
|
471
|
+
/** Whether the audio is seekable */
|
|
472
472
|
isSeekable: boolean;
|
|
473
|
-
/**
|
|
473
|
+
/** Whether the audio is of a live stream */
|
|
474
474
|
isStream: boolean;
|
|
475
475
|
/** If isrc code is available, it's provided */
|
|
476
476
|
isrc: string | null;
|
|
@@ -520,6 +520,8 @@ interface LavalinkTrack {
|
|
|
520
520
|
/** The userData Object from when you provide to the lavalink request */
|
|
521
521
|
userData?: anyObject;
|
|
522
522
|
}
|
|
523
|
+
interface TrackRequester {
|
|
524
|
+
}
|
|
523
525
|
interface Track {
|
|
524
526
|
/** The Base 64 encoded String */
|
|
525
527
|
encoded?: Base64;
|
|
@@ -528,7 +530,7 @@ interface Track {
|
|
|
528
530
|
/** Plugin Information from Lavalink */
|
|
529
531
|
pluginInfo: Partial<PluginInfo>;
|
|
530
532
|
/** The Track's Requester */
|
|
531
|
-
requester?:
|
|
533
|
+
requester?: TrackRequester;
|
|
532
534
|
/** The userData Object from when you provide to the lavalink request */
|
|
533
535
|
userData?: anyObject;
|
|
534
536
|
}
|
|
@@ -552,7 +554,7 @@ interface UnresolvedTrack {
|
|
|
552
554
|
/** The userData Object from when you provide to the lavalink request */
|
|
553
555
|
userData?: anyObject;
|
|
554
556
|
/** The Track's Requester */
|
|
555
|
-
requester?:
|
|
557
|
+
requester?: TrackRequester;
|
|
556
558
|
}
|
|
557
559
|
|
|
558
560
|
interface StoredQueue {
|
|
@@ -704,6 +706,77 @@ declare class Queue {
|
|
|
704
706
|
* @returns {number}
|
|
705
707
|
*/
|
|
706
708
|
totalDuration: () => number;
|
|
709
|
+
/**
|
|
710
|
+
* Find tracks in the queue matching specific criteria.
|
|
711
|
+
* **This method DOES NOT MUTATE the queue** - it returns a new array without modifying the original queue.
|
|
712
|
+
* @param predicate Function to test each track, or an object with criteria to match
|
|
713
|
+
* @returns Array of matching tracks with their indexes
|
|
714
|
+
*
|
|
715
|
+
* @example
|
|
716
|
+
* ```ts
|
|
717
|
+
* // Find by author
|
|
718
|
+
* const artistTracks = player.queue.utils.filterTracks({ author: "Artist Name" });
|
|
719
|
+
*
|
|
720
|
+
* // Find by duration range (5-10 minutes)
|
|
721
|
+
* const longTracks = player.queue.utils.filterTracks({ duration: { min: 300000, max: 600000 } });
|
|
722
|
+
*
|
|
723
|
+
* // Find by title (partial match)
|
|
724
|
+
* const titleMatches = player.queue.utils.filterTracks({ title: "Never Gonna" });
|
|
725
|
+
*
|
|
726
|
+
* // Custom predicate
|
|
727
|
+
* const customFilter = player.queue.utils.filterTracks(track => track.info.isStream);
|
|
728
|
+
* ```
|
|
729
|
+
*/
|
|
730
|
+
filterTracks: (predicate: ((track: Track | UnresolvedTrack, index: number) => boolean) | {
|
|
731
|
+
title?: string;
|
|
732
|
+
author?: string;
|
|
733
|
+
duration?: number | {
|
|
734
|
+
min?: number;
|
|
735
|
+
max?: number;
|
|
736
|
+
};
|
|
737
|
+
uri?: string;
|
|
738
|
+
identifier?: string;
|
|
739
|
+
sourceName?: string;
|
|
740
|
+
isStream?: boolean;
|
|
741
|
+
isSeekable?: boolean;
|
|
742
|
+
}) => Array<{
|
|
743
|
+
track: Track | UnresolvedTrack;
|
|
744
|
+
index: number;
|
|
745
|
+
}>;
|
|
746
|
+
/**
|
|
747
|
+
* Find a single track in the queue matching specific criteria.
|
|
748
|
+
* **This method DOES NOT MUTATE the queue** - it searches without modifying the original queue.
|
|
749
|
+
* @param predicate Function to test each track, or an object with criteria to match
|
|
750
|
+
* @returns First matching track with its index, or null if not found
|
|
751
|
+
*
|
|
752
|
+
* @example
|
|
753
|
+
* ```ts
|
|
754
|
+
* // Find first track by author
|
|
755
|
+
* const track = player.queue.utils.findTrack({ author: "Artist Name" });
|
|
756
|
+
* if (track) {
|
|
757
|
+
* console.log(`Found at index ${track.index}: ${track.track.info.title}`);
|
|
758
|
+
* }
|
|
759
|
+
*
|
|
760
|
+
* // Find with custom predicate
|
|
761
|
+
* const liveStream = player.queue.utils.findTrack(track => track.info.isStream);
|
|
762
|
+
* ```
|
|
763
|
+
*/
|
|
764
|
+
findTrack: (predicate: ((track: Track | UnresolvedTrack, index: number) => boolean) | {
|
|
765
|
+
title?: string;
|
|
766
|
+
author?: string;
|
|
767
|
+
duration?: number | {
|
|
768
|
+
min?: number;
|
|
769
|
+
max?: number;
|
|
770
|
+
};
|
|
771
|
+
uri?: string;
|
|
772
|
+
identifier?: string;
|
|
773
|
+
sourceName?: string;
|
|
774
|
+
isStream?: boolean;
|
|
775
|
+
isSeekable?: boolean;
|
|
776
|
+
}) => {
|
|
777
|
+
track: Track | UnresolvedTrack;
|
|
778
|
+
index: number;
|
|
779
|
+
} | null;
|
|
707
780
|
};
|
|
708
781
|
/**
|
|
709
782
|
* Shuffles the current Queue, then saves it
|
|
@@ -773,6 +846,126 @@ declare class Queue {
|
|
|
773
846
|
* ```
|
|
774
847
|
*/
|
|
775
848
|
shiftPrevious(): Promise<Track>;
|
|
849
|
+
/**
|
|
850
|
+
* Find tracks in the queue matching specific criteria.
|
|
851
|
+
* **This method DOES NOT MUTATE the queue** - it returns a new array without modifying the original queue.
|
|
852
|
+
* @deprecated Use `player.queue.utils.filterTracks()` instead.
|
|
853
|
+
* @param predicate Function to test each track, or an object with criteria to match
|
|
854
|
+
* @returns Array of matching tracks with their indexes
|
|
855
|
+
*
|
|
856
|
+
* @example
|
|
857
|
+
* ```ts
|
|
858
|
+
* // Use the new method instead:
|
|
859
|
+
* const artistTracks = player.queue.utils.filterTracks({ author: "Artist Name" });
|
|
860
|
+
* ```
|
|
861
|
+
*/
|
|
862
|
+
filter(predicate: ((track: Track | UnresolvedTrack, index: number) => boolean) | {
|
|
863
|
+
title?: string;
|
|
864
|
+
author?: string;
|
|
865
|
+
duration?: number | {
|
|
866
|
+
min?: number;
|
|
867
|
+
max?: number;
|
|
868
|
+
};
|
|
869
|
+
uri?: string;
|
|
870
|
+
identifier?: string;
|
|
871
|
+
sourceName?: string;
|
|
872
|
+
isStream?: boolean;
|
|
873
|
+
isSeekable?: boolean;
|
|
874
|
+
}): Array<{
|
|
875
|
+
track: Track | UnresolvedTrack;
|
|
876
|
+
index: number;
|
|
877
|
+
}>;
|
|
878
|
+
/**
|
|
879
|
+
* Find a single track in the queue matching specific criteria.
|
|
880
|
+
* **This method DOES NOT MUTATE the queue** - it searches without modifying the original queue.
|
|
881
|
+
* @deprecated Use `player.queue.utils.findTrack()` instead.
|
|
882
|
+
* @param predicate Function to test each track, or an object with criteria to match
|
|
883
|
+
* @returns First matching track with its index, or null if not found
|
|
884
|
+
*
|
|
885
|
+
* @example
|
|
886
|
+
* ```ts
|
|
887
|
+
* // Use the new method instead:
|
|
888
|
+
* const track = player.queue.utils.findTrack({ author: "Artist Name" });
|
|
889
|
+
* ```
|
|
890
|
+
*/
|
|
891
|
+
find(predicate: ((track: Track | UnresolvedTrack, index: number) => boolean) | {
|
|
892
|
+
title?: string;
|
|
893
|
+
author?: string;
|
|
894
|
+
duration?: number | {
|
|
895
|
+
min?: number;
|
|
896
|
+
max?: number;
|
|
897
|
+
};
|
|
898
|
+
uri?: string;
|
|
899
|
+
identifier?: string;
|
|
900
|
+
sourceName?: string;
|
|
901
|
+
isStream?: boolean;
|
|
902
|
+
isSeekable?: boolean;
|
|
903
|
+
}): {
|
|
904
|
+
track: Track | UnresolvedTrack;
|
|
905
|
+
index: number;
|
|
906
|
+
} | null;
|
|
907
|
+
/**
|
|
908
|
+
* Sort the queue tracks by a specific property.
|
|
909
|
+
* **⚠️ This method MUTATES the queue** - it modifies the original queue in place.
|
|
910
|
+
* @param sortBy Property to sort by or custom comparator function
|
|
911
|
+
* @param order Sort order: 'asc' or 'desc' (default: 'asc')
|
|
912
|
+
* @returns The queue instance for chaining
|
|
913
|
+
*
|
|
914
|
+
* @example
|
|
915
|
+
* ```ts
|
|
916
|
+
* // Sort by duration (shortest first)
|
|
917
|
+
* await player.queue.sortBy("duration", "asc");
|
|
918
|
+
*
|
|
919
|
+
* // Sort by title alphabetically (Z-A)
|
|
920
|
+
* await player.queue.sortBy("title", "desc");
|
|
921
|
+
*
|
|
922
|
+
* // Custom sorting
|
|
923
|
+
* await player.queue.sortBy((a, b) => {
|
|
924
|
+
* return a.info.title.localeCompare(b.info.title);
|
|
925
|
+
* });
|
|
926
|
+
* ```
|
|
927
|
+
*/
|
|
928
|
+
sortBy(sortBy: "duration" | "title" | "author" | ((a: Track | UnresolvedTrack, b: Track | UnresolvedTrack) => number), order?: "asc" | "desc"): Promise<this>;
|
|
929
|
+
/**
|
|
930
|
+
* Get a sorted copy of the queue tracks without modifying the original queue.
|
|
931
|
+
* **This method DOES NOT MUTATE the queue** - it returns a new sorted array, similar to `Array.toSorted()`.
|
|
932
|
+
* @param sortBy Property to sort by or custom comparator function
|
|
933
|
+
* @param order Sort order: 'asc' or 'desc' (default: 'asc')
|
|
934
|
+
* @returns A new sorted array of tracks (does not modify the queue)
|
|
935
|
+
*
|
|
936
|
+
* @example
|
|
937
|
+
* ```ts
|
|
938
|
+
* // Get sorted copy by duration (shortest first)
|
|
939
|
+
* const sortedTracks = player.queue.toSortedBy("duration", "asc");
|
|
940
|
+
* // Original queue remains unchanged
|
|
941
|
+
*
|
|
942
|
+
* // Get sorted copy by title alphabetically (Z-A)
|
|
943
|
+
* const sortedByTitle = player.queue.toSortedBy("title", "desc");
|
|
944
|
+
*
|
|
945
|
+
* // Custom sorting
|
|
946
|
+
* const customSorted = player.queue.toSortedBy((a, b) => {
|
|
947
|
+
* return a.info.title.localeCompare(b.info.title);
|
|
948
|
+
* });
|
|
949
|
+
* ```
|
|
950
|
+
*/
|
|
951
|
+
toSortedBy(sortBy: "duration" | "title" | "author" | ((a: Track | UnresolvedTrack, b: Track | UnresolvedTrack) => number), order?: "asc" | "desc"): (Track | UnresolvedTrack)[];
|
|
952
|
+
/**
|
|
953
|
+
* Get a range of tracks from the queue.
|
|
954
|
+
* **This method DOES NOT MUTATE the queue** - it returns a new array slice, similar to `Array.slice()`.
|
|
955
|
+
* @param start Start index (inclusive)
|
|
956
|
+
* @param end End index (exclusive)
|
|
957
|
+
* @returns Array of tracks in the specified range
|
|
958
|
+
*
|
|
959
|
+
* @example
|
|
960
|
+
* ```ts
|
|
961
|
+
* // Get tracks 5-15
|
|
962
|
+
* const tracks = player.queue.getTracks(5, 15);
|
|
963
|
+
*
|
|
964
|
+
* // Get first 10 tracks
|
|
965
|
+
* const firstTen = player.queue.getTracks(0, 10);
|
|
966
|
+
* ```
|
|
967
|
+
*/
|
|
968
|
+
getTracks(start: number, end?: number): (Track | UnresolvedTrack)[];
|
|
776
969
|
}
|
|
777
970
|
|
|
778
971
|
declare class Player {
|
|
@@ -1051,7 +1244,7 @@ declare class ManagerUtils {
|
|
|
1051
1244
|
*/
|
|
1052
1245
|
isNodeOptions(data: LavalinkNodeOptions): boolean;
|
|
1053
1246
|
/**
|
|
1054
|
-
* Validate tracks based on duration
|
|
1247
|
+
* Validate tracks based on duration whether they are playble or broken tracks.
|
|
1055
1248
|
* most tracks should be longer than 30s, so you can put a minDuration of 29e3 (cause preview tracks are exactly 30s) or put 0.
|
|
1056
1249
|
* This check is not done automatically, you need to check it yourself by doing:
|
|
1057
1250
|
* @example
|
|
@@ -1346,7 +1539,7 @@ interface LavalinkPlayerVoice {
|
|
|
1346
1539
|
endpoint: string;
|
|
1347
1540
|
/** The Voice SessionId */
|
|
1348
1541
|
sessionId: string;
|
|
1349
|
-
/**
|
|
1542
|
+
/** Whether or not the player is connected */
|
|
1350
1543
|
connected?: boolean;
|
|
1351
1544
|
/** The Ping to the voice server */
|
|
1352
1545
|
ping?: number;
|
|
@@ -1386,7 +1579,7 @@ interface RoutePlanner {
|
|
|
1386
1579
|
};
|
|
1387
1580
|
}
|
|
1388
1581
|
interface Session {
|
|
1389
|
-
/**
|
|
1582
|
+
/** Whether or not session is resuming or not */
|
|
1390
1583
|
resuming: boolean;
|
|
1391
1584
|
/** For how long a session is lasting while not connected */
|
|
1392
1585
|
timeout: number;
|
|
@@ -1400,9 +1593,9 @@ interface GuildShardPayload {
|
|
|
1400
1593
|
guild_id: string;
|
|
1401
1594
|
/** channel to move/connect to, or null to leave it */
|
|
1402
1595
|
channel_id: string | null;
|
|
1403
|
-
/**
|
|
1596
|
+
/** whether or not mute yourself */
|
|
1404
1597
|
self_mute: boolean;
|
|
1405
|
-
/**
|
|
1598
|
+
/** whether or not deafen yourself */
|
|
1406
1599
|
self_deaf: boolean;
|
|
1407
1600
|
};
|
|
1408
1601
|
}
|
|
@@ -1421,7 +1614,7 @@ interface LavalinkPlayer {
|
|
|
1421
1614
|
track?: LavalinkTrack;
|
|
1422
1615
|
/** Lavalink volume (mind volumedecrementer) */
|
|
1423
1616
|
volume: number;
|
|
1424
|
-
/**
|
|
1617
|
+
/** Whether it's paused or not */
|
|
1425
1618
|
paused: boolean;
|
|
1426
1619
|
/** Voice Endpoint data */
|
|
1427
1620
|
voice: LavalinkPlayerVoice;
|
|
@@ -1479,7 +1672,7 @@ interface VoiceState {
|
|
|
1479
1672
|
self_video: boolean;
|
|
1480
1673
|
/** Self Stream status */
|
|
1481
1674
|
self_stream: boolean;
|
|
1482
|
-
/**
|
|
1675
|
+
/** Whether the user requests to speak (stage channel) */
|
|
1483
1676
|
request_to_speak_timestamp: boolean;
|
|
1484
1677
|
/** Self suppressed status (stage channel) */
|
|
1485
1678
|
suppress: boolean;
|
|
@@ -1875,7 +2068,7 @@ interface PlayerJson {
|
|
|
1875
2068
|
repeatMode: RepeatMode;
|
|
1876
2069
|
/** Pause state */
|
|
1877
2070
|
paused: boolean;
|
|
1878
|
-
/**
|
|
2071
|
+
/** Whether the player was playing or not */
|
|
1879
2072
|
playing: boolean;
|
|
1880
2073
|
/** When the player was created */
|
|
1881
2074
|
createdTimeStamp?: number;
|
|
@@ -2055,7 +2248,7 @@ interface LavalinkNodeOptions {
|
|
|
2055
2248
|
closeOnError?: boolean;
|
|
2056
2249
|
/** Heartbeat interval , set to <= 0 to disable heartbeat system */
|
|
2057
2250
|
heartBeatInterval?: number;
|
|
2058
|
-
/** Recommended, to check
|
|
2251
|
+
/** Recommended, to check whether the client is still connected or not on the stats endpoint */
|
|
2059
2252
|
enablePingOnStatsCheck?: boolean;
|
|
2060
2253
|
}
|
|
2061
2254
|
/**
|
|
@@ -2252,7 +2445,7 @@ interface NodeManagerEvents {
|
|
|
2252
2445
|
"reconnecting": (node: LavalinkNode) => void;
|
|
2253
2446
|
/**
|
|
2254
2447
|
* Emitted When a node starts to reconnect (if you have a reconnection delay, the reconnecting event will be emitted after the retryDelay.)
|
|
2255
|
-
* Useful to check
|
|
2448
|
+
* Useful to check whether the internal node reconnect system works or not
|
|
2256
2449
|
* @event Manager.nodeManager#reconnectinprogress
|
|
2257
2450
|
*/
|
|
2258
2451
|
"reconnectinprogress": (node: LavalinkNode) => void;
|
|
@@ -2328,7 +2521,7 @@ declare class LavalinkNode {
|
|
|
2328
2521
|
stats: NodeStats;
|
|
2329
2522
|
/** The current sessionId, only present when connected */
|
|
2330
2523
|
sessionId?: string | null;
|
|
2331
|
-
/**
|
|
2524
|
+
/** Whether the node resuming is enabled or not */
|
|
2332
2525
|
resuming: {
|
|
2333
2526
|
enabled: boolean;
|
|
2334
2527
|
timeout: number | null;
|
|
@@ -2356,11 +2549,11 @@ declare class LavalinkNode {
|
|
|
2356
2549
|
*/
|
|
2357
2550
|
get heartBeatPing(): number;
|
|
2358
2551
|
/**
|
|
2359
|
-
* Returns
|
|
2552
|
+
* Returns whether the plugin validations are enabled or not
|
|
2360
2553
|
*/
|
|
2361
2554
|
private get _checkForPlugins();
|
|
2362
2555
|
/**
|
|
2363
|
-
* Returns
|
|
2556
|
+
* Returns whether the source validations are enabled or not
|
|
2364
2557
|
*/
|
|
2365
2558
|
private get _checkForSources();
|
|
2366
2559
|
/**
|
|
@@ -2437,7 +2630,7 @@ declare class LavalinkNode {
|
|
|
2437
2630
|
* Search something raw on the node, please note only add tracks to players of that node
|
|
2438
2631
|
* @param query SearchQuery Object
|
|
2439
2632
|
* @param requestUser Request User for creating the player(s)
|
|
2440
|
-
* @param throwOnEmpty
|
|
2633
|
+
* @param throwOnEmpty Whether to throw on an empty result or not
|
|
2441
2634
|
* @returns Searchresult
|
|
2442
2635
|
*
|
|
2443
2636
|
* @example
|
|
@@ -2452,7 +2645,7 @@ declare class LavalinkNode {
|
|
|
2452
2645
|
* Search something using the lavaSearchPlugin (filtered searches by types)
|
|
2453
2646
|
* @param query LavaSearchQuery Object
|
|
2454
2647
|
* @param requestUser Request User for creating the player(s)
|
|
2455
|
-
* @param throwOnEmpty
|
|
2648
|
+
* @param throwOnEmpty Whether to throw on an empty result or not
|
|
2456
2649
|
* @returns LavaSearchresult (SearchResult if link is provided)
|
|
2457
2650
|
*
|
|
2458
2651
|
* @example
|
|
@@ -2514,7 +2707,7 @@ declare class LavalinkNode {
|
|
|
2514
2707
|
/**
|
|
2515
2708
|
* Destroys the Node-Connection (Websocket) and all player's of the node
|
|
2516
2709
|
* @param destroyReason Destroy Reason to use when destroying the players
|
|
2517
|
-
* @param deleteNode
|
|
2710
|
+
* @param deleteNode whether to delete the nodte from the nodes list too, if false it will emit a disconnect. @default true
|
|
2518
2711
|
* @param movePlayers whether to movePlayers to different eligible connected node. If false players won't be moved @default false
|
|
2519
2712
|
* @returns void
|
|
2520
2713
|
*
|
|
@@ -2613,7 +2806,7 @@ declare class LavalinkNode {
|
|
|
2613
2806
|
/**
|
|
2614
2807
|
* Get the lyrics of a track
|
|
2615
2808
|
* @param track the track to get the lyrics for
|
|
2616
|
-
* @param skipTrackSource
|
|
2809
|
+
* @param skipTrackSource whether to skip the track source or not
|
|
2617
2810
|
* @returns the lyrics of the track
|
|
2618
2811
|
* @example
|
|
2619
2812
|
*
|
|
@@ -2628,7 +2821,7 @@ declare class LavalinkNode {
|
|
|
2628
2821
|
* Get the lyrics of the current playing track
|
|
2629
2822
|
*
|
|
2630
2823
|
* @param guildId the guild id of the player
|
|
2631
|
-
* @param skipTrackSource
|
|
2824
|
+
* @param skipTrackSource whether to skip the track source or not
|
|
2632
2825
|
* @returns the lyrics of the current playing track
|
|
2633
2826
|
* @example
|
|
2634
2827
|
* ```ts
|
|
@@ -2764,7 +2957,7 @@ declare class LavalinkNode {
|
|
|
2764
2957
|
get isNodeReconnecting(): boolean;
|
|
2765
2958
|
/**
|
|
2766
2959
|
* Reconnect to the lavalink node
|
|
2767
|
-
* @param force @default false
|
|
2960
|
+
* @param force @default false Whether to instantly try to reconnect (force it)
|
|
2768
2961
|
* @returns void
|
|
2769
2962
|
*
|
|
2770
2963
|
* @example
|
|
@@ -3031,6 +3224,13 @@ interface LavalinkManagerEvents<CustomPlayerT extends Player = Player> {
|
|
|
3031
3224
|
* @event Manager#playerDisconnect
|
|
3032
3225
|
*/
|
|
3033
3226
|
"playerDisconnect": (player: CustomPlayerT, voiceChannelId: string) => void;
|
|
3227
|
+
/**
|
|
3228
|
+
* Emitted when a Player automatically reconnects after a disconnect.
|
|
3229
|
+
* This event is triggered when the player successfully reconnects to the voice channel
|
|
3230
|
+
* and resumes playback after being disconnected (requires onDisconnect.autoReconnect to be enabled).
|
|
3231
|
+
* @event Manager#playerReconnect
|
|
3232
|
+
*/
|
|
3233
|
+
"playerReconnect": (player: CustomPlayerT, voiceChannelId: string) => void;
|
|
3034
3234
|
/**
|
|
3035
3235
|
* Emitted when a Node-Socket got closed for a specific Player.
|
|
3036
3236
|
* Usually emits when the audio websocket to discord is closed, This can happen for various reasons (normal and abnormal), e.g. when using an expired voice server update. 4xxx codes are usually bad.
|
|
@@ -3240,9 +3440,9 @@ interface ManagerOptions<CustomPlayerT extends Player = Player> {
|
|
|
3240
3440
|
linksAllowed?: boolean;
|
|
3241
3441
|
/** If the library should automatically check something, on default everything is enabled */
|
|
3242
3442
|
autoChecks?: {
|
|
3243
|
-
/**
|
|
3443
|
+
/** Whether or not the client should check if the requested source's plugin is available on the node. */
|
|
3244
3444
|
pluginValidations?: boolean;
|
|
3245
|
-
/**
|
|
3445
|
+
/** Whether or not the client should check if the requested source is available on the node */
|
|
3246
3446
|
sourcesValidations?: boolean;
|
|
3247
3447
|
};
|
|
3248
3448
|
/** Advanced Options for the Library, which may or may not be "library breaking" */
|
|
@@ -3310,7 +3510,7 @@ declare class LavalinkManager<CustomPlayerT extends Player = Player> extends Eve
|
|
|
3310
3510
|
nodeManager: NodeManager;
|
|
3311
3511
|
/** LavalinkManager's Utils Class */
|
|
3312
3512
|
utils: ManagerUtils;
|
|
3313
|
-
/**
|
|
3513
|
+
/** Whether the manager was initiated or not */
|
|
3314
3514
|
initiated: boolean;
|
|
3315
3515
|
/** All Players stored in a MiniMap */
|
|
3316
3516
|
readonly players: MiniMap<string, CustomPlayerT>;
|
|
@@ -3457,7 +3657,7 @@ declare class LavalinkManager<CustomPlayerT extends Player = Player> extends Eve
|
|
|
3457
3657
|
*/
|
|
3458
3658
|
deletePlayer(guildId: string): boolean | void;
|
|
3459
3659
|
/**
|
|
3460
|
-
* Checks
|
|
3660
|
+
* Checks whether the the lib is useable based on if any node is connected
|
|
3461
3661
|
*
|
|
3462
3662
|
* @example
|
|
3463
3663
|
* ```ts
|
|
@@ -3515,4 +3715,4 @@ declare const LavalinkPlugins: {
|
|
|
3515
3715
|
/** Lavalink Sources regexes for url validations */
|
|
3516
3716
|
declare const SourceLinksRegexes: Record<SourcesRegex, RegExp>;
|
|
3517
3717
|
|
|
3518
|
-
export { type AudioOutputs, type Awaitable, type Base64, type BaseNodeStats, type BasePlayOptions, type BotClientOptions, type CPUStats, type ChannelDeletePacket, type ChannelMixFilter, type ClientCustomSearchPlatformUtils, type ClientSearchPlatform, DebugEvents, type DeepRequired, DefaultQueueStore, DefaultSources, DestroyReasons, type DestroyReasonsType, DisconnectReasons, type DisconnectReasonsType, type DistortionFilter, type DuncteSearchPlatform, type EQBand, EQList, type Exception, type FailingAddress, type FilterData, FilterManager, type FloatNumber, type FrameStats, type GitObject, type GuildShardPayload, type IntegerNumber, type InvalidLavalinkRestRequest, type JioSaavnSearchPlatform, type KaraokeFilter, type LavaSearchFilteredResponse, type LavaSearchQuery, type LavaSearchResponse, type LavaSearchType, type LavaSrcSearchPlatform, type LavaSrcSearchPlatformBase, type LavalinkClientSearchPlatform, type LavalinkClientSearchPlatformResolve, type LavalinkFilterData, type LavalinkInfo, LavalinkManager, type LavalinkManagerEvents, LavalinkNode, type LavalinkNodeIdentifier, type LavalinkNodeOptions, type LavalinkPlayOptions, type LavalinkPlayer, type LavalinkPlayerVoice, type LavalinkPlayerVoiceOptions, type LavalinkPlugin_JioSaavn_SourceNames, type LavalinkPlugin_LavaSrc_SourceNames, LavalinkPlugins, type LavalinkSearchPlatform, type LavalinkSourceNames, type LavalinkTrack, type LavalinkTrackInfo, type LoadTypes, type LowPassFilter, type LyricsEvent, type LyricsEventType, type LyricsFoundEvent, type LyricsLine, type LyricsLineEvent, type LyricsNotFoundEvent, type LyricsResult, type ManagerOptions, type ManagerPlayerOptions, type ManagerQueueOptions, ManagerUtils, type MemoryStats, MiniMap, type MiniMapConstructor, type ModifyRequest, type NodeLinkConnectionMetrics, NodeManager, type NodeManagerEvents, type NodeMessage, type NodeStats, NodeSymbol, type Opaque, type PlayOptions, Player, type PlayerEvent, type PlayerEventType, type PlayerEvents, type PlayerFilters, type PlayerJson, type PlayerOptions, type PlayerUpdateInfo, type PlaylistInfo, type PluginInfo, type PluginObject, Queue, type QueueChangesWatcher, QueueSaver, type QueueStoreManager, QueueSymbol, ReconnectionState, type RepeatMode, type RequiredManagerOptions, type RotationFilter, type RoutePlanner, type RoutePlannerTypes, type SearchPlatform, type SearchQuery, type SearchResult, type Session, type Severity, SourceLinksRegexes, type SourceNames, type SourcesRegex, type SponsorBlockChapterStarted, type SponsorBlockChaptersLoaded, type SponsorBlockSegment, type SponsorBlockSegmentEventType, type SponsorBlockSegmentEvents, type SponsorBlockSegmentSkipped, type SponsorBlockSegmentsLoaded, type State, type StoredQueue, type TimescaleFilter, type Track, type TrackEndEvent, type TrackEndReason, type TrackExceptionEvent, type TrackInfo, type TrackStartEvent, type TrackStuckEvent, TrackSymbol, type TremoloFilter, type UnresolvedQuery, type UnresolvedSearchResult, type UnresolvedTrack, type UnresolvedTrackInfo, UnresolvedTrackSymbol, type VersionObject, type VibratoFilter, type VoicePacket, type VoiceServer, type VoiceState, type WebSocketClosedEvent, type anyObject, audioOutputsData, parseLavalinkConnUrl, queueTrackEnd, safeStringify, validSponsorBlocks };
|
|
3718
|
+
export { type AudioOutputs, type Awaitable, type Base64, type BaseNodeStats, type BasePlayOptions, type BotClientOptions, type CPUStats, type ChannelDeletePacket, type ChannelMixFilter, type ClientCustomSearchPlatformUtils, type ClientSearchPlatform, DebugEvents, type DeepRequired, DefaultQueueStore, DefaultSources, DestroyReasons, type DestroyReasonsType, DisconnectReasons, type DisconnectReasonsType, type DistortionFilter, type DuncteSearchPlatform, type EQBand, EQList, type Exception, type FailingAddress, type FilterData, FilterManager, type FloatNumber, type FrameStats, type GitObject, type GuildShardPayload, type IntegerNumber, type InvalidLavalinkRestRequest, type JioSaavnSearchPlatform, type KaraokeFilter, type LavaSearchFilteredResponse, type LavaSearchQuery, type LavaSearchResponse, type LavaSearchType, type LavaSrcSearchPlatform, type LavaSrcSearchPlatformBase, type LavalinkClientSearchPlatform, type LavalinkClientSearchPlatformResolve, type LavalinkFilterData, type LavalinkInfo, LavalinkManager, type LavalinkManagerEvents, LavalinkNode, type LavalinkNodeIdentifier, type LavalinkNodeOptions, type LavalinkPlayOptions, type LavalinkPlayer, type LavalinkPlayerVoice, type LavalinkPlayerVoiceOptions, type LavalinkPlugin_JioSaavn_SourceNames, type LavalinkPlugin_LavaSrc_SourceNames, LavalinkPlugins, type LavalinkSearchPlatform, type LavalinkSourceNames, type LavalinkTrack, type LavalinkTrackInfo, type LoadTypes, type LowPassFilter, type LyricsEvent, type LyricsEventType, type LyricsFoundEvent, type LyricsLine, type LyricsLineEvent, type LyricsNotFoundEvent, type LyricsResult, type ManagerOptions, type ManagerPlayerOptions, type ManagerQueueOptions, ManagerUtils, type MemoryStats, MiniMap, type MiniMapConstructor, type ModifyRequest, type NodeLinkConnectionMetrics, NodeManager, type NodeManagerEvents, type NodeMessage, type NodeStats, NodeSymbol, type Opaque, type PlayOptions, Player, type PlayerEvent, type PlayerEventType, type PlayerEvents, type PlayerFilters, type PlayerJson, type PlayerOptions, type PlayerUpdateInfo, type PlaylistInfo, type PluginInfo, type PluginObject, Queue, type QueueChangesWatcher, QueueSaver, type QueueStoreManager, QueueSymbol, ReconnectionState, type RepeatMode, type RequiredManagerOptions, type RotationFilter, type RoutePlanner, type RoutePlannerTypes, type SearchPlatform, type SearchQuery, type SearchResult, type Session, type Severity, SourceLinksRegexes, type SourceNames, type SourcesRegex, type SponsorBlockChapterStarted, type SponsorBlockChaptersLoaded, type SponsorBlockSegment, type SponsorBlockSegmentEventType, type SponsorBlockSegmentEvents, type SponsorBlockSegmentSkipped, type SponsorBlockSegmentsLoaded, type State, type StoredQueue, type TimescaleFilter, type Track, type TrackEndEvent, type TrackEndReason, type TrackExceptionEvent, type TrackInfo, type TrackRequester, type TrackStartEvent, type TrackStuckEvent, TrackSymbol, type TremoloFilter, type UnresolvedQuery, type UnresolvedSearchResult, type UnresolvedTrack, type UnresolvedTrackInfo, UnresolvedTrackSymbol, type VersionObject, type VibratoFilter, type VoicePacket, type VoiceServer, type VoiceState, type WebSocketClosedEvent, type anyObject, audioOutputsData, parseLavalinkConnUrl, queueTrackEnd, safeStringify, validSponsorBlocks };
|