lavalink-client 2.7.8 → 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 +53 -1
- package/dist/index.d.mts +34 -32
- package/dist/index.d.ts +34 -32
- package/dist/index.js +17 -17
- package/dist/index.mjs +17 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -106,6 +106,55 @@ pnpm add tomato6966/lavalink-client
|
|
|
106
106
|
|
|
107
107
|
***
|
|
108
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
|
+
|
|
109
158
|
## 💖 Used In
|
|
110
159
|
This client powers various Discord bots:
|
|
111
160
|
- **[Mivator](https://discord.gg/5dUb7M2qCj)** (Public Bot by @Tomato6966)
|
|
@@ -118,12 +167,13 @@ This client powers various Discord bots:
|
|
|
118
167
|
- [Akyn](https://akynbot.vercel.app/) (@notdeltaxd)
|
|
119
168
|
- [ARINO](https://site.arinoapp.qzz.io/) (@ryanwtf88)
|
|
120
169
|
- [iHorizon](https://github.com/ihrz/ihrz) (@iHorizon)
|
|
121
|
-
- **Bots Community (Users):**
|
|
170
|
+
- **Bots By Community (Users):**
|
|
122
171
|
- [Soundy](https://github.com/idMJA/Soundy) (@idMJA)
|
|
123
172
|
- [BeatBot](https://getbeatbot.vercel.app/) (@zenitsujs)
|
|
124
173
|
- [Atom Music](https://top.gg/bot/1320469557411971165) (@sakshamyep)
|
|
125
174
|
- [All Time Bot](https://top.gg/bot/1163027457671180418) (@PeterGamez)
|
|
126
175
|
- [BeatDock](https://github.com/lazaroagomez/BeatDock) (@lazaroagomez)
|
|
176
|
+
- [Nazha](https://top.gg/bot/1124681788070055967) (@Nazha-Team)
|
|
127
177
|
|
|
128
178
|
***
|
|
129
179
|
|
|
@@ -464,3 +514,5 @@ if (response.tracks.length > 0) {
|
|
|
464
514
|
</details>
|
|
465
515
|
|
|
466
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 {
|
|
@@ -1242,7 +1244,7 @@ declare class ManagerUtils {
|
|
|
1242
1244
|
*/
|
|
1243
1245
|
isNodeOptions(data: LavalinkNodeOptions): boolean;
|
|
1244
1246
|
/**
|
|
1245
|
-
* Validate tracks based on duration
|
|
1247
|
+
* Validate tracks based on duration whether they are playble or broken tracks.
|
|
1246
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.
|
|
1247
1249
|
* This check is not done automatically, you need to check it yourself by doing:
|
|
1248
1250
|
* @example
|
|
@@ -1537,7 +1539,7 @@ interface LavalinkPlayerVoice {
|
|
|
1537
1539
|
endpoint: string;
|
|
1538
1540
|
/** The Voice SessionId */
|
|
1539
1541
|
sessionId: string;
|
|
1540
|
-
/**
|
|
1542
|
+
/** Whether or not the player is connected */
|
|
1541
1543
|
connected?: boolean;
|
|
1542
1544
|
/** The Ping to the voice server */
|
|
1543
1545
|
ping?: number;
|
|
@@ -1577,7 +1579,7 @@ interface RoutePlanner {
|
|
|
1577
1579
|
};
|
|
1578
1580
|
}
|
|
1579
1581
|
interface Session {
|
|
1580
|
-
/**
|
|
1582
|
+
/** Whether or not session is resuming or not */
|
|
1581
1583
|
resuming: boolean;
|
|
1582
1584
|
/** For how long a session is lasting while not connected */
|
|
1583
1585
|
timeout: number;
|
|
@@ -1591,9 +1593,9 @@ interface GuildShardPayload {
|
|
|
1591
1593
|
guild_id: string;
|
|
1592
1594
|
/** channel to move/connect to, or null to leave it */
|
|
1593
1595
|
channel_id: string | null;
|
|
1594
|
-
/**
|
|
1596
|
+
/** whether or not mute yourself */
|
|
1595
1597
|
self_mute: boolean;
|
|
1596
|
-
/**
|
|
1598
|
+
/** whether or not deafen yourself */
|
|
1597
1599
|
self_deaf: boolean;
|
|
1598
1600
|
};
|
|
1599
1601
|
}
|
|
@@ -1612,7 +1614,7 @@ interface LavalinkPlayer {
|
|
|
1612
1614
|
track?: LavalinkTrack;
|
|
1613
1615
|
/** Lavalink volume (mind volumedecrementer) */
|
|
1614
1616
|
volume: number;
|
|
1615
|
-
/**
|
|
1617
|
+
/** Whether it's paused or not */
|
|
1616
1618
|
paused: boolean;
|
|
1617
1619
|
/** Voice Endpoint data */
|
|
1618
1620
|
voice: LavalinkPlayerVoice;
|
|
@@ -1670,7 +1672,7 @@ interface VoiceState {
|
|
|
1670
1672
|
self_video: boolean;
|
|
1671
1673
|
/** Self Stream status */
|
|
1672
1674
|
self_stream: boolean;
|
|
1673
|
-
/**
|
|
1675
|
+
/** Whether the user requests to speak (stage channel) */
|
|
1674
1676
|
request_to_speak_timestamp: boolean;
|
|
1675
1677
|
/** Self suppressed status (stage channel) */
|
|
1676
1678
|
suppress: boolean;
|
|
@@ -2066,7 +2068,7 @@ interface PlayerJson {
|
|
|
2066
2068
|
repeatMode: RepeatMode;
|
|
2067
2069
|
/** Pause state */
|
|
2068
2070
|
paused: boolean;
|
|
2069
|
-
/**
|
|
2071
|
+
/** Whether the player was playing or not */
|
|
2070
2072
|
playing: boolean;
|
|
2071
2073
|
/** When the player was created */
|
|
2072
2074
|
createdTimeStamp?: number;
|
|
@@ -2246,7 +2248,7 @@ interface LavalinkNodeOptions {
|
|
|
2246
2248
|
closeOnError?: boolean;
|
|
2247
2249
|
/** Heartbeat interval , set to <= 0 to disable heartbeat system */
|
|
2248
2250
|
heartBeatInterval?: number;
|
|
2249
|
-
/** Recommended, to check
|
|
2251
|
+
/** Recommended, to check whether the client is still connected or not on the stats endpoint */
|
|
2250
2252
|
enablePingOnStatsCheck?: boolean;
|
|
2251
2253
|
}
|
|
2252
2254
|
/**
|
|
@@ -2443,7 +2445,7 @@ interface NodeManagerEvents {
|
|
|
2443
2445
|
"reconnecting": (node: LavalinkNode) => void;
|
|
2444
2446
|
/**
|
|
2445
2447
|
* Emitted When a node starts to reconnect (if you have a reconnection delay, the reconnecting event will be emitted after the retryDelay.)
|
|
2446
|
-
* Useful to check
|
|
2448
|
+
* Useful to check whether the internal node reconnect system works or not
|
|
2447
2449
|
* @event Manager.nodeManager#reconnectinprogress
|
|
2448
2450
|
*/
|
|
2449
2451
|
"reconnectinprogress": (node: LavalinkNode) => void;
|
|
@@ -2519,7 +2521,7 @@ declare class LavalinkNode {
|
|
|
2519
2521
|
stats: NodeStats;
|
|
2520
2522
|
/** The current sessionId, only present when connected */
|
|
2521
2523
|
sessionId?: string | null;
|
|
2522
|
-
/**
|
|
2524
|
+
/** Whether the node resuming is enabled or not */
|
|
2523
2525
|
resuming: {
|
|
2524
2526
|
enabled: boolean;
|
|
2525
2527
|
timeout: number | null;
|
|
@@ -2547,11 +2549,11 @@ declare class LavalinkNode {
|
|
|
2547
2549
|
*/
|
|
2548
2550
|
get heartBeatPing(): number;
|
|
2549
2551
|
/**
|
|
2550
|
-
* Returns
|
|
2552
|
+
* Returns whether the plugin validations are enabled or not
|
|
2551
2553
|
*/
|
|
2552
2554
|
private get _checkForPlugins();
|
|
2553
2555
|
/**
|
|
2554
|
-
* Returns
|
|
2556
|
+
* Returns whether the source validations are enabled or not
|
|
2555
2557
|
*/
|
|
2556
2558
|
private get _checkForSources();
|
|
2557
2559
|
/**
|
|
@@ -2628,7 +2630,7 @@ declare class LavalinkNode {
|
|
|
2628
2630
|
* Search something raw on the node, please note only add tracks to players of that node
|
|
2629
2631
|
* @param query SearchQuery Object
|
|
2630
2632
|
* @param requestUser Request User for creating the player(s)
|
|
2631
|
-
* @param throwOnEmpty
|
|
2633
|
+
* @param throwOnEmpty Whether to throw on an empty result or not
|
|
2632
2634
|
* @returns Searchresult
|
|
2633
2635
|
*
|
|
2634
2636
|
* @example
|
|
@@ -2643,7 +2645,7 @@ declare class LavalinkNode {
|
|
|
2643
2645
|
* Search something using the lavaSearchPlugin (filtered searches by types)
|
|
2644
2646
|
* @param query LavaSearchQuery Object
|
|
2645
2647
|
* @param requestUser Request User for creating the player(s)
|
|
2646
|
-
* @param throwOnEmpty
|
|
2648
|
+
* @param throwOnEmpty Whether to throw on an empty result or not
|
|
2647
2649
|
* @returns LavaSearchresult (SearchResult if link is provided)
|
|
2648
2650
|
*
|
|
2649
2651
|
* @example
|
|
@@ -2705,7 +2707,7 @@ declare class LavalinkNode {
|
|
|
2705
2707
|
/**
|
|
2706
2708
|
* Destroys the Node-Connection (Websocket) and all player's of the node
|
|
2707
2709
|
* @param destroyReason Destroy Reason to use when destroying the players
|
|
2708
|
-
* @param deleteNode
|
|
2710
|
+
* @param deleteNode whether to delete the nodte from the nodes list too, if false it will emit a disconnect. @default true
|
|
2709
2711
|
* @param movePlayers whether to movePlayers to different eligible connected node. If false players won't be moved @default false
|
|
2710
2712
|
* @returns void
|
|
2711
2713
|
*
|
|
@@ -2804,7 +2806,7 @@ declare class LavalinkNode {
|
|
|
2804
2806
|
/**
|
|
2805
2807
|
* Get the lyrics of a track
|
|
2806
2808
|
* @param track the track to get the lyrics for
|
|
2807
|
-
* @param skipTrackSource
|
|
2809
|
+
* @param skipTrackSource whether to skip the track source or not
|
|
2808
2810
|
* @returns the lyrics of the track
|
|
2809
2811
|
* @example
|
|
2810
2812
|
*
|
|
@@ -2819,7 +2821,7 @@ declare class LavalinkNode {
|
|
|
2819
2821
|
* Get the lyrics of the current playing track
|
|
2820
2822
|
*
|
|
2821
2823
|
* @param guildId the guild id of the player
|
|
2822
|
-
* @param skipTrackSource
|
|
2824
|
+
* @param skipTrackSource whether to skip the track source or not
|
|
2823
2825
|
* @returns the lyrics of the current playing track
|
|
2824
2826
|
* @example
|
|
2825
2827
|
* ```ts
|
|
@@ -2955,7 +2957,7 @@ declare class LavalinkNode {
|
|
|
2955
2957
|
get isNodeReconnecting(): boolean;
|
|
2956
2958
|
/**
|
|
2957
2959
|
* Reconnect to the lavalink node
|
|
2958
|
-
* @param force @default false
|
|
2960
|
+
* @param force @default false Whether to instantly try to reconnect (force it)
|
|
2959
2961
|
* @returns void
|
|
2960
2962
|
*
|
|
2961
2963
|
* @example
|
|
@@ -3438,9 +3440,9 @@ interface ManagerOptions<CustomPlayerT extends Player = Player> {
|
|
|
3438
3440
|
linksAllowed?: boolean;
|
|
3439
3441
|
/** If the library should automatically check something, on default everything is enabled */
|
|
3440
3442
|
autoChecks?: {
|
|
3441
|
-
/**
|
|
3443
|
+
/** Whether or not the client should check if the requested source's plugin is available on the node. */
|
|
3442
3444
|
pluginValidations?: boolean;
|
|
3443
|
-
/**
|
|
3445
|
+
/** Whether or not the client should check if the requested source is available on the node */
|
|
3444
3446
|
sourcesValidations?: boolean;
|
|
3445
3447
|
};
|
|
3446
3448
|
/** Advanced Options for the Library, which may or may not be "library breaking" */
|
|
@@ -3508,7 +3510,7 @@ declare class LavalinkManager<CustomPlayerT extends Player = Player> extends Eve
|
|
|
3508
3510
|
nodeManager: NodeManager;
|
|
3509
3511
|
/** LavalinkManager's Utils Class */
|
|
3510
3512
|
utils: ManagerUtils;
|
|
3511
|
-
/**
|
|
3513
|
+
/** Whether the manager was initiated or not */
|
|
3512
3514
|
initiated: boolean;
|
|
3513
3515
|
/** All Players stored in a MiniMap */
|
|
3514
3516
|
readonly players: MiniMap<string, CustomPlayerT>;
|
|
@@ -3655,7 +3657,7 @@ declare class LavalinkManager<CustomPlayerT extends Player = Player> extends Eve
|
|
|
3655
3657
|
*/
|
|
3656
3658
|
deletePlayer(guildId: string): boolean | void;
|
|
3657
3659
|
/**
|
|
3658
|
-
* Checks
|
|
3660
|
+
* Checks whether the the lib is useable based on if any node is connected
|
|
3659
3661
|
*
|
|
3660
3662
|
* @example
|
|
3661
3663
|
* ```ts
|
|
@@ -3713,4 +3715,4 @@ declare const LavalinkPlugins: {
|
|
|
3713
3715
|
/** Lavalink Sources regexes for url validations */
|
|
3714
3716
|
declare const SourceLinksRegexes: Record<SourcesRegex, RegExp>;
|
|
3715
3717
|
|
|
3716
|
-
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 };
|
package/dist/index.d.ts
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 {
|
|
@@ -1242,7 +1244,7 @@ declare class ManagerUtils {
|
|
|
1242
1244
|
*/
|
|
1243
1245
|
isNodeOptions(data: LavalinkNodeOptions): boolean;
|
|
1244
1246
|
/**
|
|
1245
|
-
* Validate tracks based on duration
|
|
1247
|
+
* Validate tracks based on duration whether they are playble or broken tracks.
|
|
1246
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.
|
|
1247
1249
|
* This check is not done automatically, you need to check it yourself by doing:
|
|
1248
1250
|
* @example
|
|
@@ -1537,7 +1539,7 @@ interface LavalinkPlayerVoice {
|
|
|
1537
1539
|
endpoint: string;
|
|
1538
1540
|
/** The Voice SessionId */
|
|
1539
1541
|
sessionId: string;
|
|
1540
|
-
/**
|
|
1542
|
+
/** Whether or not the player is connected */
|
|
1541
1543
|
connected?: boolean;
|
|
1542
1544
|
/** The Ping to the voice server */
|
|
1543
1545
|
ping?: number;
|
|
@@ -1577,7 +1579,7 @@ interface RoutePlanner {
|
|
|
1577
1579
|
};
|
|
1578
1580
|
}
|
|
1579
1581
|
interface Session {
|
|
1580
|
-
/**
|
|
1582
|
+
/** Whether or not session is resuming or not */
|
|
1581
1583
|
resuming: boolean;
|
|
1582
1584
|
/** For how long a session is lasting while not connected */
|
|
1583
1585
|
timeout: number;
|
|
@@ -1591,9 +1593,9 @@ interface GuildShardPayload {
|
|
|
1591
1593
|
guild_id: string;
|
|
1592
1594
|
/** channel to move/connect to, or null to leave it */
|
|
1593
1595
|
channel_id: string | null;
|
|
1594
|
-
/**
|
|
1596
|
+
/** whether or not mute yourself */
|
|
1595
1597
|
self_mute: boolean;
|
|
1596
|
-
/**
|
|
1598
|
+
/** whether or not deafen yourself */
|
|
1597
1599
|
self_deaf: boolean;
|
|
1598
1600
|
};
|
|
1599
1601
|
}
|
|
@@ -1612,7 +1614,7 @@ interface LavalinkPlayer {
|
|
|
1612
1614
|
track?: LavalinkTrack;
|
|
1613
1615
|
/** Lavalink volume (mind volumedecrementer) */
|
|
1614
1616
|
volume: number;
|
|
1615
|
-
/**
|
|
1617
|
+
/** Whether it's paused or not */
|
|
1616
1618
|
paused: boolean;
|
|
1617
1619
|
/** Voice Endpoint data */
|
|
1618
1620
|
voice: LavalinkPlayerVoice;
|
|
@@ -1670,7 +1672,7 @@ interface VoiceState {
|
|
|
1670
1672
|
self_video: boolean;
|
|
1671
1673
|
/** Self Stream status */
|
|
1672
1674
|
self_stream: boolean;
|
|
1673
|
-
/**
|
|
1675
|
+
/** Whether the user requests to speak (stage channel) */
|
|
1674
1676
|
request_to_speak_timestamp: boolean;
|
|
1675
1677
|
/** Self suppressed status (stage channel) */
|
|
1676
1678
|
suppress: boolean;
|
|
@@ -2066,7 +2068,7 @@ interface PlayerJson {
|
|
|
2066
2068
|
repeatMode: RepeatMode;
|
|
2067
2069
|
/** Pause state */
|
|
2068
2070
|
paused: boolean;
|
|
2069
|
-
/**
|
|
2071
|
+
/** Whether the player was playing or not */
|
|
2070
2072
|
playing: boolean;
|
|
2071
2073
|
/** When the player was created */
|
|
2072
2074
|
createdTimeStamp?: number;
|
|
@@ -2246,7 +2248,7 @@ interface LavalinkNodeOptions {
|
|
|
2246
2248
|
closeOnError?: boolean;
|
|
2247
2249
|
/** Heartbeat interval , set to <= 0 to disable heartbeat system */
|
|
2248
2250
|
heartBeatInterval?: number;
|
|
2249
|
-
/** Recommended, to check
|
|
2251
|
+
/** Recommended, to check whether the client is still connected or not on the stats endpoint */
|
|
2250
2252
|
enablePingOnStatsCheck?: boolean;
|
|
2251
2253
|
}
|
|
2252
2254
|
/**
|
|
@@ -2443,7 +2445,7 @@ interface NodeManagerEvents {
|
|
|
2443
2445
|
"reconnecting": (node: LavalinkNode) => void;
|
|
2444
2446
|
/**
|
|
2445
2447
|
* Emitted When a node starts to reconnect (if you have a reconnection delay, the reconnecting event will be emitted after the retryDelay.)
|
|
2446
|
-
* Useful to check
|
|
2448
|
+
* Useful to check whether the internal node reconnect system works or not
|
|
2447
2449
|
* @event Manager.nodeManager#reconnectinprogress
|
|
2448
2450
|
*/
|
|
2449
2451
|
"reconnectinprogress": (node: LavalinkNode) => void;
|
|
@@ -2519,7 +2521,7 @@ declare class LavalinkNode {
|
|
|
2519
2521
|
stats: NodeStats;
|
|
2520
2522
|
/** The current sessionId, only present when connected */
|
|
2521
2523
|
sessionId?: string | null;
|
|
2522
|
-
/**
|
|
2524
|
+
/** Whether the node resuming is enabled or not */
|
|
2523
2525
|
resuming: {
|
|
2524
2526
|
enabled: boolean;
|
|
2525
2527
|
timeout: number | null;
|
|
@@ -2547,11 +2549,11 @@ declare class LavalinkNode {
|
|
|
2547
2549
|
*/
|
|
2548
2550
|
get heartBeatPing(): number;
|
|
2549
2551
|
/**
|
|
2550
|
-
* Returns
|
|
2552
|
+
* Returns whether the plugin validations are enabled or not
|
|
2551
2553
|
*/
|
|
2552
2554
|
private get _checkForPlugins();
|
|
2553
2555
|
/**
|
|
2554
|
-
* Returns
|
|
2556
|
+
* Returns whether the source validations are enabled or not
|
|
2555
2557
|
*/
|
|
2556
2558
|
private get _checkForSources();
|
|
2557
2559
|
/**
|
|
@@ -2628,7 +2630,7 @@ declare class LavalinkNode {
|
|
|
2628
2630
|
* Search something raw on the node, please note only add tracks to players of that node
|
|
2629
2631
|
* @param query SearchQuery Object
|
|
2630
2632
|
* @param requestUser Request User for creating the player(s)
|
|
2631
|
-
* @param throwOnEmpty
|
|
2633
|
+
* @param throwOnEmpty Whether to throw on an empty result or not
|
|
2632
2634
|
* @returns Searchresult
|
|
2633
2635
|
*
|
|
2634
2636
|
* @example
|
|
@@ -2643,7 +2645,7 @@ declare class LavalinkNode {
|
|
|
2643
2645
|
* Search something using the lavaSearchPlugin (filtered searches by types)
|
|
2644
2646
|
* @param query LavaSearchQuery Object
|
|
2645
2647
|
* @param requestUser Request User for creating the player(s)
|
|
2646
|
-
* @param throwOnEmpty
|
|
2648
|
+
* @param throwOnEmpty Whether to throw on an empty result or not
|
|
2647
2649
|
* @returns LavaSearchresult (SearchResult if link is provided)
|
|
2648
2650
|
*
|
|
2649
2651
|
* @example
|
|
@@ -2705,7 +2707,7 @@ declare class LavalinkNode {
|
|
|
2705
2707
|
/**
|
|
2706
2708
|
* Destroys the Node-Connection (Websocket) and all player's of the node
|
|
2707
2709
|
* @param destroyReason Destroy Reason to use when destroying the players
|
|
2708
|
-
* @param deleteNode
|
|
2710
|
+
* @param deleteNode whether to delete the nodte from the nodes list too, if false it will emit a disconnect. @default true
|
|
2709
2711
|
* @param movePlayers whether to movePlayers to different eligible connected node. If false players won't be moved @default false
|
|
2710
2712
|
* @returns void
|
|
2711
2713
|
*
|
|
@@ -2804,7 +2806,7 @@ declare class LavalinkNode {
|
|
|
2804
2806
|
/**
|
|
2805
2807
|
* Get the lyrics of a track
|
|
2806
2808
|
* @param track the track to get the lyrics for
|
|
2807
|
-
* @param skipTrackSource
|
|
2809
|
+
* @param skipTrackSource whether to skip the track source or not
|
|
2808
2810
|
* @returns the lyrics of the track
|
|
2809
2811
|
* @example
|
|
2810
2812
|
*
|
|
@@ -2819,7 +2821,7 @@ declare class LavalinkNode {
|
|
|
2819
2821
|
* Get the lyrics of the current playing track
|
|
2820
2822
|
*
|
|
2821
2823
|
* @param guildId the guild id of the player
|
|
2822
|
-
* @param skipTrackSource
|
|
2824
|
+
* @param skipTrackSource whether to skip the track source or not
|
|
2823
2825
|
* @returns the lyrics of the current playing track
|
|
2824
2826
|
* @example
|
|
2825
2827
|
* ```ts
|
|
@@ -2955,7 +2957,7 @@ declare class LavalinkNode {
|
|
|
2955
2957
|
get isNodeReconnecting(): boolean;
|
|
2956
2958
|
/**
|
|
2957
2959
|
* Reconnect to the lavalink node
|
|
2958
|
-
* @param force @default false
|
|
2960
|
+
* @param force @default false Whether to instantly try to reconnect (force it)
|
|
2959
2961
|
* @returns void
|
|
2960
2962
|
*
|
|
2961
2963
|
* @example
|
|
@@ -3438,9 +3440,9 @@ interface ManagerOptions<CustomPlayerT extends Player = Player> {
|
|
|
3438
3440
|
linksAllowed?: boolean;
|
|
3439
3441
|
/** If the library should automatically check something, on default everything is enabled */
|
|
3440
3442
|
autoChecks?: {
|
|
3441
|
-
/**
|
|
3443
|
+
/** Whether or not the client should check if the requested source's plugin is available on the node. */
|
|
3442
3444
|
pluginValidations?: boolean;
|
|
3443
|
-
/**
|
|
3445
|
+
/** Whether or not the client should check if the requested source is available on the node */
|
|
3444
3446
|
sourcesValidations?: boolean;
|
|
3445
3447
|
};
|
|
3446
3448
|
/** Advanced Options for the Library, which may or may not be "library breaking" */
|
|
@@ -3508,7 +3510,7 @@ declare class LavalinkManager<CustomPlayerT extends Player = Player> extends Eve
|
|
|
3508
3510
|
nodeManager: NodeManager;
|
|
3509
3511
|
/** LavalinkManager's Utils Class */
|
|
3510
3512
|
utils: ManagerUtils;
|
|
3511
|
-
/**
|
|
3513
|
+
/** Whether the manager was initiated or not */
|
|
3512
3514
|
initiated: boolean;
|
|
3513
3515
|
/** All Players stored in a MiniMap */
|
|
3514
3516
|
readonly players: MiniMap<string, CustomPlayerT>;
|
|
@@ -3655,7 +3657,7 @@ declare class LavalinkManager<CustomPlayerT extends Player = Player> extends Eve
|
|
|
3655
3657
|
*/
|
|
3656
3658
|
deletePlayer(guildId: string): boolean | void;
|
|
3657
3659
|
/**
|
|
3658
|
-
* Checks
|
|
3660
|
+
* Checks whether the the lib is useable based on if any node is connected
|
|
3659
3661
|
*
|
|
3660
3662
|
* @example
|
|
3661
3663
|
* ```ts
|
|
@@ -3713,4 +3715,4 @@ declare const LavalinkPlugins: {
|
|
|
3713
3715
|
/** Lavalink Sources regexes for url validations */
|
|
3714
3716
|
declare const SourceLinksRegexes: Record<SourcesRegex, RegExp>;
|
|
3715
3717
|
|
|
3716
|
-
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 };
|
package/dist/index.js
CHANGED
|
@@ -686,7 +686,7 @@ var ManagerUtils = class {
|
|
|
686
686
|
return true;
|
|
687
687
|
}
|
|
688
688
|
/**
|
|
689
|
-
* Validate tracks based on duration
|
|
689
|
+
* Validate tracks based on duration whether they are playble or broken tracks.
|
|
690
690
|
* most tracks should be longer than 30s, so you can put a minDuration of 29e3 (cause preview tracks are exactly 30s) or put 0.
|
|
691
691
|
* This check is not done automatically, you need to check it yourself by doing:
|
|
692
692
|
* @example
|
|
@@ -762,7 +762,7 @@ var ManagerUtils = class {
|
|
|
762
762
|
functionLayer: "(LavalinkNode > node | player) > search() > validateQueryString()"
|
|
763
763
|
});
|
|
764
764
|
}
|
|
765
|
-
if (this.LavalinkManager.options?.linksBlacklist.some((v) => typeof v === "string" &&
|
|
765
|
+
if (this.LavalinkManager.options?.linksBlacklist.some((v) => typeof v === "string" && queryString.toLowerCase().includes(v.toLowerCase()) || (0, import_types.isRegExp)(v) && v.test(queryString))) {
|
|
766
766
|
throw new Error(`Query string contains a link / word which is blacklisted.`);
|
|
767
767
|
}
|
|
768
768
|
}
|
|
@@ -776,7 +776,7 @@ var ManagerUtils = class {
|
|
|
776
776
|
functionLayer: "(LavalinkNode > node | player) > search() > validateQueryString()"
|
|
777
777
|
});
|
|
778
778
|
}
|
|
779
|
-
if (!this.LavalinkManager.options?.linksWhitelist.some((v) => typeof v === "string" &&
|
|
779
|
+
if (!this.LavalinkManager.options?.linksWhitelist.some((v) => typeof v === "string" && queryString.toLowerCase().includes(v.toLowerCase()) || (0, import_types.isRegExp)(v) && v.test(queryString))) {
|
|
780
780
|
throw new Error(`Query string contains a link / word which isn't whitelisted.`);
|
|
781
781
|
}
|
|
782
782
|
}
|
|
@@ -1089,7 +1089,7 @@ var LavalinkNode = class {
|
|
|
1089
1089
|
};
|
|
1090
1090
|
/** The current sessionId, only present when connected */
|
|
1091
1091
|
sessionId = null;
|
|
1092
|
-
/**
|
|
1092
|
+
/** Whether the node resuming is enabled or not */
|
|
1093
1093
|
resuming = { enabled: true, timeout: null };
|
|
1094
1094
|
/** Actual Lavalink Information of the Node */
|
|
1095
1095
|
info = null;
|
|
@@ -1118,13 +1118,13 @@ var LavalinkNode = class {
|
|
|
1118
1118
|
return this.heartBeatPongTimestamp - this.heartBeatPingTimestamp;
|
|
1119
1119
|
}
|
|
1120
1120
|
/**
|
|
1121
|
-
* Returns
|
|
1121
|
+
* Returns whether the plugin validations are enabled or not
|
|
1122
1122
|
*/
|
|
1123
1123
|
get _checkForPlugins() {
|
|
1124
1124
|
return !!this._LManager.options?.autoChecks?.pluginValidations;
|
|
1125
1125
|
}
|
|
1126
1126
|
/**
|
|
1127
|
-
* Returns
|
|
1127
|
+
* Returns whether the source validations are enabled or not
|
|
1128
1128
|
*/
|
|
1129
1129
|
get _checkForSources() {
|
|
1130
1130
|
return !!this._LManager.options?.autoChecks?.sourcesValidations;
|
|
@@ -1245,7 +1245,7 @@ var LavalinkNode = class {
|
|
|
1245
1245
|
* Search something raw on the node, please note only add tracks to players of that node
|
|
1246
1246
|
* @param query SearchQuery Object
|
|
1247
1247
|
* @param requestUser Request User for creating the player(s)
|
|
1248
|
-
* @param throwOnEmpty
|
|
1248
|
+
* @param throwOnEmpty Whether to throw on an empty result or not
|
|
1249
1249
|
* @returns Searchresult
|
|
1250
1250
|
*
|
|
1251
1251
|
* @example
|
|
@@ -1305,7 +1305,7 @@ var LavalinkNode = class {
|
|
|
1305
1305
|
* Search something using the lavaSearchPlugin (filtered searches by types)
|
|
1306
1306
|
* @param query LavaSearchQuery Object
|
|
1307
1307
|
* @param requestUser Request User for creating the player(s)
|
|
1308
|
-
* @param throwOnEmpty
|
|
1308
|
+
* @param throwOnEmpty Whether to throw on an empty result or not
|
|
1309
1309
|
* @returns LavaSearchresult (SearchResult if link is provided)
|
|
1310
1310
|
*
|
|
1311
1311
|
* @example
|
|
@@ -1466,7 +1466,7 @@ var LavalinkNode = class {
|
|
|
1466
1466
|
/**
|
|
1467
1467
|
* Destroys the Node-Connection (Websocket) and all player's of the node
|
|
1468
1468
|
* @param destroyReason Destroy Reason to use when destroying the players
|
|
1469
|
-
* @param deleteNode
|
|
1469
|
+
* @param deleteNode whether to delete the nodte from the nodes list too, if false it will emit a disconnect. @default true
|
|
1470
1470
|
* @param movePlayers whether to movePlayers to different eligible connected node. If false players won't be moved @default false
|
|
1471
1471
|
* @returns void
|
|
1472
1472
|
*
|
|
@@ -1674,7 +1674,7 @@ var LavalinkNode = class {
|
|
|
1674
1674
|
/**
|
|
1675
1675
|
* Get the lyrics of a track
|
|
1676
1676
|
* @param track the track to get the lyrics for
|
|
1677
|
-
* @param skipTrackSource
|
|
1677
|
+
* @param skipTrackSource whether to skip the track source or not
|
|
1678
1678
|
* @returns the lyrics of the track
|
|
1679
1679
|
* @example
|
|
1680
1680
|
*
|
|
@@ -1695,7 +1695,7 @@ var LavalinkNode = class {
|
|
|
1695
1695
|
* Get the lyrics of the current playing track
|
|
1696
1696
|
*
|
|
1697
1697
|
* @param guildId the guild id of the player
|
|
1698
|
-
* @param skipTrackSource
|
|
1698
|
+
* @param skipTrackSource whether to skip the track source or not
|
|
1699
1699
|
* @returns the lyrics of the current playing track
|
|
1700
1700
|
* @example
|
|
1701
1701
|
* ```ts
|
|
@@ -1772,7 +1772,7 @@ var LavalinkNode = class {
|
|
|
1772
1772
|
* ```
|
|
1773
1773
|
*/
|
|
1774
1774
|
async fetchConnectionMetrics() {
|
|
1775
|
-
if (this.info && !this.info.isNodelink) throw new Error("There is no Information about
|
|
1775
|
+
if (this.info && !this.info.isNodelink) throw new Error("There is no Information about whether you are using NodeLink instead of Lavalink, so this function won't work");
|
|
1776
1776
|
return await this.request(`/connection`);
|
|
1777
1777
|
}
|
|
1778
1778
|
/**
|
|
@@ -1932,7 +1932,7 @@ var LavalinkNode = class {
|
|
|
1932
1932
|
}
|
|
1933
1933
|
/**
|
|
1934
1934
|
* Reconnect to the lavalink node
|
|
1935
|
-
* @param force @default false
|
|
1935
|
+
* @param force @default false Whether to instantly try to reconnect (force it)
|
|
1936
1936
|
* @returns void
|
|
1937
1937
|
*
|
|
1938
1938
|
* @example
|
|
@@ -2947,13 +2947,13 @@ var FilterManager = class {
|
|
|
2947
2947
|
return this.player.LavalinkManager;
|
|
2948
2948
|
}
|
|
2949
2949
|
/**
|
|
2950
|
-
* Returns
|
|
2950
|
+
* Returns whether the plugin validations are enabled or not
|
|
2951
2951
|
*/
|
|
2952
2952
|
get _checkForPlugins() {
|
|
2953
2953
|
return !!this._LManager.options?.autoChecks?.pluginValidations;
|
|
2954
2954
|
}
|
|
2955
2955
|
/**
|
|
2956
|
-
* Returns
|
|
2956
|
+
* Returns whether the source validations are enabled or not
|
|
2957
2957
|
*/
|
|
2958
2958
|
get _checkForSources() {
|
|
2959
2959
|
return !!this._LManager.options?.autoChecks?.sourcesValidations;
|
|
@@ -5005,7 +5005,7 @@ var LavalinkManager = class extends import_events2.EventEmitter {
|
|
|
5005
5005
|
nodeManager;
|
|
5006
5006
|
/** LavalinkManager's Utils Class */
|
|
5007
5007
|
utils;
|
|
5008
|
-
/**
|
|
5008
|
+
/** Whether the manager was initiated or not */
|
|
5009
5009
|
initiated = false;
|
|
5010
5010
|
/** All Players stored in a MiniMap */
|
|
5011
5011
|
players = new MiniMap();
|
|
@@ -5270,7 +5270,7 @@ var LavalinkManager = class extends import_events2.EventEmitter {
|
|
|
5270
5270
|
return this.players.delete(guildId);
|
|
5271
5271
|
}
|
|
5272
5272
|
/**
|
|
5273
|
-
* Checks
|
|
5273
|
+
* Checks whether the the lib is useable based on if any node is connected
|
|
5274
5274
|
*
|
|
5275
5275
|
* @example
|
|
5276
5276
|
* ```ts
|
package/dist/index.mjs
CHANGED
|
@@ -625,7 +625,7 @@ var ManagerUtils = class {
|
|
|
625
625
|
return true;
|
|
626
626
|
}
|
|
627
627
|
/**
|
|
628
|
-
* Validate tracks based on duration
|
|
628
|
+
* Validate tracks based on duration whether they are playble or broken tracks.
|
|
629
629
|
* most tracks should be longer than 30s, so you can put a minDuration of 29e3 (cause preview tracks are exactly 30s) or put 0.
|
|
630
630
|
* This check is not done automatically, you need to check it yourself by doing:
|
|
631
631
|
* @example
|
|
@@ -701,7 +701,7 @@ var ManagerUtils = class {
|
|
|
701
701
|
functionLayer: "(LavalinkNode > node | player) > search() > validateQueryString()"
|
|
702
702
|
});
|
|
703
703
|
}
|
|
704
|
-
if (this.LavalinkManager.options?.linksBlacklist.some((v) => typeof v === "string" &&
|
|
704
|
+
if (this.LavalinkManager.options?.linksBlacklist.some((v) => typeof v === "string" && queryString.toLowerCase().includes(v.toLowerCase()) || isRegExp(v) && v.test(queryString))) {
|
|
705
705
|
throw new Error(`Query string contains a link / word which is blacklisted.`);
|
|
706
706
|
}
|
|
707
707
|
}
|
|
@@ -715,7 +715,7 @@ var ManagerUtils = class {
|
|
|
715
715
|
functionLayer: "(LavalinkNode > node | player) > search() > validateQueryString()"
|
|
716
716
|
});
|
|
717
717
|
}
|
|
718
|
-
if (!this.LavalinkManager.options?.linksWhitelist.some((v) => typeof v === "string" &&
|
|
718
|
+
if (!this.LavalinkManager.options?.linksWhitelist.some((v) => typeof v === "string" && queryString.toLowerCase().includes(v.toLowerCase()) || isRegExp(v) && v.test(queryString))) {
|
|
719
719
|
throw new Error(`Query string contains a link / word which isn't whitelisted.`);
|
|
720
720
|
}
|
|
721
721
|
}
|
|
@@ -1028,7 +1028,7 @@ var LavalinkNode = class {
|
|
|
1028
1028
|
};
|
|
1029
1029
|
/** The current sessionId, only present when connected */
|
|
1030
1030
|
sessionId = null;
|
|
1031
|
-
/**
|
|
1031
|
+
/** Whether the node resuming is enabled or not */
|
|
1032
1032
|
resuming = { enabled: true, timeout: null };
|
|
1033
1033
|
/** Actual Lavalink Information of the Node */
|
|
1034
1034
|
info = null;
|
|
@@ -1057,13 +1057,13 @@ var LavalinkNode = class {
|
|
|
1057
1057
|
return this.heartBeatPongTimestamp - this.heartBeatPingTimestamp;
|
|
1058
1058
|
}
|
|
1059
1059
|
/**
|
|
1060
|
-
* Returns
|
|
1060
|
+
* Returns whether the plugin validations are enabled or not
|
|
1061
1061
|
*/
|
|
1062
1062
|
get _checkForPlugins() {
|
|
1063
1063
|
return !!this._LManager.options?.autoChecks?.pluginValidations;
|
|
1064
1064
|
}
|
|
1065
1065
|
/**
|
|
1066
|
-
* Returns
|
|
1066
|
+
* Returns whether the source validations are enabled or not
|
|
1067
1067
|
*/
|
|
1068
1068
|
get _checkForSources() {
|
|
1069
1069
|
return !!this._LManager.options?.autoChecks?.sourcesValidations;
|
|
@@ -1184,7 +1184,7 @@ var LavalinkNode = class {
|
|
|
1184
1184
|
* Search something raw on the node, please note only add tracks to players of that node
|
|
1185
1185
|
* @param query SearchQuery Object
|
|
1186
1186
|
* @param requestUser Request User for creating the player(s)
|
|
1187
|
-
* @param throwOnEmpty
|
|
1187
|
+
* @param throwOnEmpty Whether to throw on an empty result or not
|
|
1188
1188
|
* @returns Searchresult
|
|
1189
1189
|
*
|
|
1190
1190
|
* @example
|
|
@@ -1244,7 +1244,7 @@ var LavalinkNode = class {
|
|
|
1244
1244
|
* Search something using the lavaSearchPlugin (filtered searches by types)
|
|
1245
1245
|
* @param query LavaSearchQuery Object
|
|
1246
1246
|
* @param requestUser Request User for creating the player(s)
|
|
1247
|
-
* @param throwOnEmpty
|
|
1247
|
+
* @param throwOnEmpty Whether to throw on an empty result or not
|
|
1248
1248
|
* @returns LavaSearchresult (SearchResult if link is provided)
|
|
1249
1249
|
*
|
|
1250
1250
|
* @example
|
|
@@ -1405,7 +1405,7 @@ var LavalinkNode = class {
|
|
|
1405
1405
|
/**
|
|
1406
1406
|
* Destroys the Node-Connection (Websocket) and all player's of the node
|
|
1407
1407
|
* @param destroyReason Destroy Reason to use when destroying the players
|
|
1408
|
-
* @param deleteNode
|
|
1408
|
+
* @param deleteNode whether to delete the nodte from the nodes list too, if false it will emit a disconnect. @default true
|
|
1409
1409
|
* @param movePlayers whether to movePlayers to different eligible connected node. If false players won't be moved @default false
|
|
1410
1410
|
* @returns void
|
|
1411
1411
|
*
|
|
@@ -1613,7 +1613,7 @@ var LavalinkNode = class {
|
|
|
1613
1613
|
/**
|
|
1614
1614
|
* Get the lyrics of a track
|
|
1615
1615
|
* @param track the track to get the lyrics for
|
|
1616
|
-
* @param skipTrackSource
|
|
1616
|
+
* @param skipTrackSource whether to skip the track source or not
|
|
1617
1617
|
* @returns the lyrics of the track
|
|
1618
1618
|
* @example
|
|
1619
1619
|
*
|
|
@@ -1634,7 +1634,7 @@ var LavalinkNode = class {
|
|
|
1634
1634
|
* Get the lyrics of the current playing track
|
|
1635
1635
|
*
|
|
1636
1636
|
* @param guildId the guild id of the player
|
|
1637
|
-
* @param skipTrackSource
|
|
1637
|
+
* @param skipTrackSource whether to skip the track source or not
|
|
1638
1638
|
* @returns the lyrics of the current playing track
|
|
1639
1639
|
* @example
|
|
1640
1640
|
* ```ts
|
|
@@ -1711,7 +1711,7 @@ var LavalinkNode = class {
|
|
|
1711
1711
|
* ```
|
|
1712
1712
|
*/
|
|
1713
1713
|
async fetchConnectionMetrics() {
|
|
1714
|
-
if (this.info && !this.info.isNodelink) throw new Error("There is no Information about
|
|
1714
|
+
if (this.info && !this.info.isNodelink) throw new Error("There is no Information about whether you are using NodeLink instead of Lavalink, so this function won't work");
|
|
1715
1715
|
return await this.request(`/connection`);
|
|
1716
1716
|
}
|
|
1717
1717
|
/**
|
|
@@ -1871,7 +1871,7 @@ var LavalinkNode = class {
|
|
|
1871
1871
|
}
|
|
1872
1872
|
/**
|
|
1873
1873
|
* Reconnect to the lavalink node
|
|
1874
|
-
* @param force @default false
|
|
1874
|
+
* @param force @default false Whether to instantly try to reconnect (force it)
|
|
1875
1875
|
* @returns void
|
|
1876
1876
|
*
|
|
1877
1877
|
* @example
|
|
@@ -2886,13 +2886,13 @@ var FilterManager = class {
|
|
|
2886
2886
|
return this.player.LavalinkManager;
|
|
2887
2887
|
}
|
|
2888
2888
|
/**
|
|
2889
|
-
* Returns
|
|
2889
|
+
* Returns whether the plugin validations are enabled or not
|
|
2890
2890
|
*/
|
|
2891
2891
|
get _checkForPlugins() {
|
|
2892
2892
|
return !!this._LManager.options?.autoChecks?.pluginValidations;
|
|
2893
2893
|
}
|
|
2894
2894
|
/**
|
|
2895
|
-
* Returns
|
|
2895
|
+
* Returns whether the source validations are enabled or not
|
|
2896
2896
|
*/
|
|
2897
2897
|
get _checkForSources() {
|
|
2898
2898
|
return !!this._LManager.options?.autoChecks?.sourcesValidations;
|
|
@@ -4944,7 +4944,7 @@ var LavalinkManager = class extends EventEmitter2 {
|
|
|
4944
4944
|
nodeManager;
|
|
4945
4945
|
/** LavalinkManager's Utils Class */
|
|
4946
4946
|
utils;
|
|
4947
|
-
/**
|
|
4947
|
+
/** Whether the manager was initiated or not */
|
|
4948
4948
|
initiated = false;
|
|
4949
4949
|
/** All Players stored in a MiniMap */
|
|
4950
4950
|
players = new MiniMap();
|
|
@@ -5209,7 +5209,7 @@ var LavalinkManager = class extends EventEmitter2 {
|
|
|
5209
5209
|
return this.players.delete(guildId);
|
|
5210
5210
|
}
|
|
5211
5211
|
/**
|
|
5212
|
-
* Checks
|
|
5212
|
+
* Checks whether the the lib is useable based on if any node is connected
|
|
5213
5213
|
*
|
|
5214
5214
|
* @example
|
|
5215
5215
|
* ```ts
|
package/package.json
CHANGED