lavalink-client 2.7.4 → 2.7.6
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 +120 -27
- package/dist/index.d.ts +120 -27
- package/dist/index.js +557 -559
- package/dist/index.mjs +557 -559
- package/package.json +78 -78
package/dist/index.d.mts
CHANGED
|
@@ -24,6 +24,15 @@ declare class FilterManager {
|
|
|
24
24
|
data: FilterData;
|
|
25
25
|
/** The Player assigned to this Filter Manager */
|
|
26
26
|
player: Player;
|
|
27
|
+
private get _LManager();
|
|
28
|
+
/**
|
|
29
|
+
* Returns wether the plugin validations are enabled or not
|
|
30
|
+
*/
|
|
31
|
+
private get _checkForPlugins();
|
|
32
|
+
/**
|
|
33
|
+
* Returns wether the source validations are enabled or not
|
|
34
|
+
*/
|
|
35
|
+
private get _checkForSources();
|
|
27
36
|
/** The Constructor for the FilterManager */
|
|
28
37
|
constructor(player: Player);
|
|
29
38
|
/**
|
|
@@ -820,6 +829,12 @@ declare class Player {
|
|
|
820
829
|
};
|
|
821
830
|
/** Custom data for the player */
|
|
822
831
|
private readonly data;
|
|
832
|
+
/**
|
|
833
|
+
* Emits a debug event to the LavalinkManager
|
|
834
|
+
* @param name name of the event
|
|
835
|
+
* @param eventData event data
|
|
836
|
+
*/
|
|
837
|
+
private _emitDebugEvent;
|
|
823
838
|
/**
|
|
824
839
|
* Create a new Player
|
|
825
840
|
* @param options
|
|
@@ -1774,7 +1789,10 @@ declare enum DebugEvents {
|
|
|
1774
1789
|
PlayerDeleteInsteadOfDestroy = "PlayerDeleteInsteadOfDestroy",
|
|
1775
1790
|
FailedToConnectToNodes = "FailedToConnectToNodes",
|
|
1776
1791
|
NoAudioDebug = "NoAudioDebug",
|
|
1777
|
-
PlayerAutoReconnect = "PlayerAutoReconnect"
|
|
1792
|
+
PlayerAutoReconnect = "PlayerAutoReconnect",
|
|
1793
|
+
PlayerDestroyFail = "PlayerDestroyFail",
|
|
1794
|
+
PlayerChangeNodeFailNoEligibleNode = "PlayerChangeNodeFailNoEligibleNode",
|
|
1795
|
+
PlayerChangeNodeFail = "PlayerChangeNodeFail"
|
|
1778
1796
|
}
|
|
1779
1797
|
/**
|
|
1780
1798
|
* Reasons why a player got destroyed
|
|
@@ -2032,12 +2050,41 @@ interface BaseNodeStats {
|
|
|
2032
2050
|
/** The frame stats for the node. */
|
|
2033
2051
|
frameStats: FrameStats;
|
|
2034
2052
|
}
|
|
2053
|
+
interface NodeLinkConnectionMetrics {
|
|
2054
|
+
status: string;
|
|
2055
|
+
metrics: {
|
|
2056
|
+
speed: {
|
|
2057
|
+
bps: number;
|
|
2058
|
+
kbps: number;
|
|
2059
|
+
mbps: number;
|
|
2060
|
+
};
|
|
2061
|
+
downloadedBytes: number;
|
|
2062
|
+
durationSeconds: number;
|
|
2063
|
+
timestamp: number;
|
|
2064
|
+
};
|
|
2065
|
+
}
|
|
2035
2066
|
/**
|
|
2036
2067
|
* Interface for nodeStats from lavalink
|
|
2037
2068
|
*/
|
|
2038
2069
|
interface NodeStats extends BaseNodeStats {
|
|
2039
2070
|
/** The frame stats for the node. */
|
|
2040
2071
|
frameStats: FrameStats;
|
|
2072
|
+
/** something from nodeLink https://nodelink.js.org/docs/differences#detailed-statistics */
|
|
2073
|
+
detailedStats?: {
|
|
2074
|
+
api: {
|
|
2075
|
+
/** e.g. { "/v4/loadtracks": 150, "/v4/info": 5 } */
|
|
2076
|
+
requests: Record<string, number>;
|
|
2077
|
+
errors: unknown;
|
|
2078
|
+
};
|
|
2079
|
+
/** e.g. { "youtube": 150, "soundcloud": 5 } */
|
|
2080
|
+
sources: Record<string, number>;
|
|
2081
|
+
playback: {
|
|
2082
|
+
/** e.g. { "TrackStartEvent": 150, "TrackEndEvent": 5 } */
|
|
2083
|
+
events: Record<string, number>;
|
|
2084
|
+
};
|
|
2085
|
+
/** and potential others */
|
|
2086
|
+
[key: string]: unknown;
|
|
2087
|
+
};
|
|
2041
2088
|
}
|
|
2042
2089
|
/**
|
|
2043
2090
|
* Entire lavalink information object from lavalink
|
|
@@ -2059,6 +2106,8 @@ interface LavalinkInfo {
|
|
|
2059
2106
|
filters: string[];
|
|
2060
2107
|
/** The enabled plugins for this server */
|
|
2061
2108
|
plugins: PluginObject[];
|
|
2109
|
+
/** Something from NodeLink: https://nodelink.js.org/docs/differences#server-info */
|
|
2110
|
+
isNodelink?: boolean;
|
|
2062
2111
|
}
|
|
2063
2112
|
/**
|
|
2064
2113
|
* Lavalink's version object from lavalink
|
|
@@ -2189,7 +2238,6 @@ declare enum ReconnectionState {
|
|
|
2189
2238
|
declare class LavalinkNode {
|
|
2190
2239
|
private heartBeatPingTimestamp;
|
|
2191
2240
|
private heartBeatPongTimestamp;
|
|
2192
|
-
get heartBeatPing(): number;
|
|
2193
2241
|
private heartBeatInterval?;
|
|
2194
2242
|
private pingTimeout?;
|
|
2195
2243
|
isAlive: boolean;
|
|
@@ -2220,6 +2268,52 @@ declare class LavalinkNode {
|
|
|
2220
2268
|
private socket;
|
|
2221
2269
|
/** Version of what the Lavalink Server should be */
|
|
2222
2270
|
private version;
|
|
2271
|
+
/**
|
|
2272
|
+
* Returns the LavalinkManager of the Node
|
|
2273
|
+
*/
|
|
2274
|
+
private get _LManager();
|
|
2275
|
+
/**
|
|
2276
|
+
* Returns the Heartbeat Ping of the Node
|
|
2277
|
+
*/
|
|
2278
|
+
get heartBeatPing(): number;
|
|
2279
|
+
/**
|
|
2280
|
+
* Returns wether the plugin validations are enabled or not
|
|
2281
|
+
*/
|
|
2282
|
+
private get _checkForPlugins();
|
|
2283
|
+
/**
|
|
2284
|
+
* Returns wether the source validations are enabled or not
|
|
2285
|
+
*/
|
|
2286
|
+
private get _checkForSources();
|
|
2287
|
+
/**
|
|
2288
|
+
* Emits a debug event to the LavalinkManager
|
|
2289
|
+
* @param name name of the event
|
|
2290
|
+
* @param eventData event data
|
|
2291
|
+
*/
|
|
2292
|
+
private _emitDebugEvent;
|
|
2293
|
+
/**
|
|
2294
|
+
* Returns if connected to the Node.
|
|
2295
|
+
*
|
|
2296
|
+
* @example
|
|
2297
|
+
* ```ts
|
|
2298
|
+
* const isConnected = player.node.connected;
|
|
2299
|
+
* console.log("node is connected: ", isConnected ? "yes" : "no")
|
|
2300
|
+
* ```
|
|
2301
|
+
*/
|
|
2302
|
+
get connected(): boolean;
|
|
2303
|
+
/**
|
|
2304
|
+
* Returns the current ConnectionStatus
|
|
2305
|
+
*
|
|
2306
|
+
* @example
|
|
2307
|
+
* ```ts
|
|
2308
|
+
* try {
|
|
2309
|
+
* const statusOfConnection = player.node.connectionStatus;
|
|
2310
|
+
* console.log("node's connection status is:", statusOfConnection)
|
|
2311
|
+
* } catch (error) {
|
|
2312
|
+
* console.error("no socket available?", error)
|
|
2313
|
+
* }
|
|
2314
|
+
* ```
|
|
2315
|
+
*/
|
|
2316
|
+
get connectionStatus(): string;
|
|
2223
2317
|
/**
|
|
2224
2318
|
* Create a new Node
|
|
2225
2319
|
* @param options Lavalink Node Options
|
|
@@ -2369,30 +2463,6 @@ declare class LavalinkNode {
|
|
|
2369
2463
|
* ```
|
|
2370
2464
|
*/
|
|
2371
2465
|
disconnect(disconnectReason?: DisconnectReasonsType): void;
|
|
2372
|
-
/**
|
|
2373
|
-
* Returns if connected to the Node.
|
|
2374
|
-
*
|
|
2375
|
-
* @example
|
|
2376
|
-
* ```ts
|
|
2377
|
-
* const isConnected = player.node.connected;
|
|
2378
|
-
* console.log("node is connected: ", isConnected ? "yes" : "no")
|
|
2379
|
-
* ```
|
|
2380
|
-
*/
|
|
2381
|
-
get connected(): boolean;
|
|
2382
|
-
/**
|
|
2383
|
-
* Returns the current ConnectionStatus
|
|
2384
|
-
*
|
|
2385
|
-
* @example
|
|
2386
|
-
* ```ts
|
|
2387
|
-
* try {
|
|
2388
|
-
* const statusOfConnection = player.node.connectionStatus;
|
|
2389
|
-
* console.log("node's connection status is:", statusOfConnection)
|
|
2390
|
-
* } catch (error) {
|
|
2391
|
-
* console.error("no socket available?", error)
|
|
2392
|
-
* }
|
|
2393
|
-
* ```
|
|
2394
|
-
*/
|
|
2395
|
-
get connectionStatus(): string;
|
|
2396
2466
|
/**
|
|
2397
2467
|
* Gets all Players of a Node
|
|
2398
2468
|
* @returns array of players inside of lavalink
|
|
@@ -2526,6 +2596,16 @@ declare class LavalinkNode {
|
|
|
2526
2596
|
* ```
|
|
2527
2597
|
*/
|
|
2528
2598
|
fetchStats(): Promise<BaseNodeStats>;
|
|
2599
|
+
/**
|
|
2600
|
+
* Request NodeLink connection metrics. https://nodelink.js.org/docs/differences#connection-metrics
|
|
2601
|
+
* @returns the connection metrics of the node
|
|
2602
|
+
*
|
|
2603
|
+
* @example
|
|
2604
|
+
* ```ts
|
|
2605
|
+
* const connectionMetrics = await player.node.fetchConnectionMetrics();
|
|
2606
|
+
* ```
|
|
2607
|
+
*/
|
|
2608
|
+
fetchConnectionMetrics(): Promise<NodeLinkConnectionMetrics>;
|
|
2529
2609
|
/**
|
|
2530
2610
|
* Request Lavalink version.
|
|
2531
2611
|
* @returns the current used lavalink version
|
|
@@ -3071,6 +3151,13 @@ interface ManagerOptions<CustomPlayerT extends Player = Player> {
|
|
|
3071
3151
|
linksBlacklist?: (RegExp | string)[];
|
|
3072
3152
|
/** If links should be allowed or not. If set to false, it will throw an error if a link was provided. */
|
|
3073
3153
|
linksAllowed?: boolean;
|
|
3154
|
+
/** If the library should automatically check something, on default everything is enabled */
|
|
3155
|
+
autoChecks?: {
|
|
3156
|
+
/** Wether or not the client should check if the requested source's plugin is available on the node. */
|
|
3157
|
+
pluginValidations?: boolean;
|
|
3158
|
+
/** Wether or not the client should check if the requested source is available on the node */
|
|
3159
|
+
sourcesValidations?: boolean;
|
|
3160
|
+
};
|
|
3074
3161
|
/** Advanced Options for the Library, which may or may not be "library breaking" */
|
|
3075
3162
|
advancedOptions?: {
|
|
3076
3163
|
/** Max duration for that the filter fix duration works (in ms) - default is 8mins */
|
|
@@ -3151,6 +3238,12 @@ declare class LavalinkManager<CustomPlayerT extends Player = Player> extends Eve
|
|
|
3151
3238
|
* @param options
|
|
3152
3239
|
*/
|
|
3153
3240
|
private validateOptions;
|
|
3241
|
+
/**
|
|
3242
|
+
* Emits a debug event to the LavalinkManager
|
|
3243
|
+
* @param name name of the event
|
|
3244
|
+
* @param eventData event data
|
|
3245
|
+
*/
|
|
3246
|
+
private _emitDebugEvent;
|
|
3154
3247
|
/**
|
|
3155
3248
|
* Create the Lavalink Manager
|
|
3156
3249
|
* @param options
|
|
@@ -3335,4 +3428,4 @@ declare const LavalinkPlugins: {
|
|
|
3335
3428
|
/** Lavalink Sources regexes for url validations */
|
|
3336
3429
|
declare const SourceLinksRegexes: Record<SourcesRegex, RegExp>;
|
|
3337
3430
|
|
|
3338
|
-
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, 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 };
|
|
3431
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,15 @@ declare class FilterManager {
|
|
|
24
24
|
data: FilterData;
|
|
25
25
|
/** The Player assigned to this Filter Manager */
|
|
26
26
|
player: Player;
|
|
27
|
+
private get _LManager();
|
|
28
|
+
/**
|
|
29
|
+
* Returns wether the plugin validations are enabled or not
|
|
30
|
+
*/
|
|
31
|
+
private get _checkForPlugins();
|
|
32
|
+
/**
|
|
33
|
+
* Returns wether the source validations are enabled or not
|
|
34
|
+
*/
|
|
35
|
+
private get _checkForSources();
|
|
27
36
|
/** The Constructor for the FilterManager */
|
|
28
37
|
constructor(player: Player);
|
|
29
38
|
/**
|
|
@@ -820,6 +829,12 @@ declare class Player {
|
|
|
820
829
|
};
|
|
821
830
|
/** Custom data for the player */
|
|
822
831
|
private readonly data;
|
|
832
|
+
/**
|
|
833
|
+
* Emits a debug event to the LavalinkManager
|
|
834
|
+
* @param name name of the event
|
|
835
|
+
* @param eventData event data
|
|
836
|
+
*/
|
|
837
|
+
private _emitDebugEvent;
|
|
823
838
|
/**
|
|
824
839
|
* Create a new Player
|
|
825
840
|
* @param options
|
|
@@ -1774,7 +1789,10 @@ declare enum DebugEvents {
|
|
|
1774
1789
|
PlayerDeleteInsteadOfDestroy = "PlayerDeleteInsteadOfDestroy",
|
|
1775
1790
|
FailedToConnectToNodes = "FailedToConnectToNodes",
|
|
1776
1791
|
NoAudioDebug = "NoAudioDebug",
|
|
1777
|
-
PlayerAutoReconnect = "PlayerAutoReconnect"
|
|
1792
|
+
PlayerAutoReconnect = "PlayerAutoReconnect",
|
|
1793
|
+
PlayerDestroyFail = "PlayerDestroyFail",
|
|
1794
|
+
PlayerChangeNodeFailNoEligibleNode = "PlayerChangeNodeFailNoEligibleNode",
|
|
1795
|
+
PlayerChangeNodeFail = "PlayerChangeNodeFail"
|
|
1778
1796
|
}
|
|
1779
1797
|
/**
|
|
1780
1798
|
* Reasons why a player got destroyed
|
|
@@ -2032,12 +2050,41 @@ interface BaseNodeStats {
|
|
|
2032
2050
|
/** The frame stats for the node. */
|
|
2033
2051
|
frameStats: FrameStats;
|
|
2034
2052
|
}
|
|
2053
|
+
interface NodeLinkConnectionMetrics {
|
|
2054
|
+
status: string;
|
|
2055
|
+
metrics: {
|
|
2056
|
+
speed: {
|
|
2057
|
+
bps: number;
|
|
2058
|
+
kbps: number;
|
|
2059
|
+
mbps: number;
|
|
2060
|
+
};
|
|
2061
|
+
downloadedBytes: number;
|
|
2062
|
+
durationSeconds: number;
|
|
2063
|
+
timestamp: number;
|
|
2064
|
+
};
|
|
2065
|
+
}
|
|
2035
2066
|
/**
|
|
2036
2067
|
* Interface for nodeStats from lavalink
|
|
2037
2068
|
*/
|
|
2038
2069
|
interface NodeStats extends BaseNodeStats {
|
|
2039
2070
|
/** The frame stats for the node. */
|
|
2040
2071
|
frameStats: FrameStats;
|
|
2072
|
+
/** something from nodeLink https://nodelink.js.org/docs/differences#detailed-statistics */
|
|
2073
|
+
detailedStats?: {
|
|
2074
|
+
api: {
|
|
2075
|
+
/** e.g. { "/v4/loadtracks": 150, "/v4/info": 5 } */
|
|
2076
|
+
requests: Record<string, number>;
|
|
2077
|
+
errors: unknown;
|
|
2078
|
+
};
|
|
2079
|
+
/** e.g. { "youtube": 150, "soundcloud": 5 } */
|
|
2080
|
+
sources: Record<string, number>;
|
|
2081
|
+
playback: {
|
|
2082
|
+
/** e.g. { "TrackStartEvent": 150, "TrackEndEvent": 5 } */
|
|
2083
|
+
events: Record<string, number>;
|
|
2084
|
+
};
|
|
2085
|
+
/** and potential others */
|
|
2086
|
+
[key: string]: unknown;
|
|
2087
|
+
};
|
|
2041
2088
|
}
|
|
2042
2089
|
/**
|
|
2043
2090
|
* Entire lavalink information object from lavalink
|
|
@@ -2059,6 +2106,8 @@ interface LavalinkInfo {
|
|
|
2059
2106
|
filters: string[];
|
|
2060
2107
|
/** The enabled plugins for this server */
|
|
2061
2108
|
plugins: PluginObject[];
|
|
2109
|
+
/** Something from NodeLink: https://nodelink.js.org/docs/differences#server-info */
|
|
2110
|
+
isNodelink?: boolean;
|
|
2062
2111
|
}
|
|
2063
2112
|
/**
|
|
2064
2113
|
* Lavalink's version object from lavalink
|
|
@@ -2189,7 +2238,6 @@ declare enum ReconnectionState {
|
|
|
2189
2238
|
declare class LavalinkNode {
|
|
2190
2239
|
private heartBeatPingTimestamp;
|
|
2191
2240
|
private heartBeatPongTimestamp;
|
|
2192
|
-
get heartBeatPing(): number;
|
|
2193
2241
|
private heartBeatInterval?;
|
|
2194
2242
|
private pingTimeout?;
|
|
2195
2243
|
isAlive: boolean;
|
|
@@ -2220,6 +2268,52 @@ declare class LavalinkNode {
|
|
|
2220
2268
|
private socket;
|
|
2221
2269
|
/** Version of what the Lavalink Server should be */
|
|
2222
2270
|
private version;
|
|
2271
|
+
/**
|
|
2272
|
+
* Returns the LavalinkManager of the Node
|
|
2273
|
+
*/
|
|
2274
|
+
private get _LManager();
|
|
2275
|
+
/**
|
|
2276
|
+
* Returns the Heartbeat Ping of the Node
|
|
2277
|
+
*/
|
|
2278
|
+
get heartBeatPing(): number;
|
|
2279
|
+
/**
|
|
2280
|
+
* Returns wether the plugin validations are enabled or not
|
|
2281
|
+
*/
|
|
2282
|
+
private get _checkForPlugins();
|
|
2283
|
+
/**
|
|
2284
|
+
* Returns wether the source validations are enabled or not
|
|
2285
|
+
*/
|
|
2286
|
+
private get _checkForSources();
|
|
2287
|
+
/**
|
|
2288
|
+
* Emits a debug event to the LavalinkManager
|
|
2289
|
+
* @param name name of the event
|
|
2290
|
+
* @param eventData event data
|
|
2291
|
+
*/
|
|
2292
|
+
private _emitDebugEvent;
|
|
2293
|
+
/**
|
|
2294
|
+
* Returns if connected to the Node.
|
|
2295
|
+
*
|
|
2296
|
+
* @example
|
|
2297
|
+
* ```ts
|
|
2298
|
+
* const isConnected = player.node.connected;
|
|
2299
|
+
* console.log("node is connected: ", isConnected ? "yes" : "no")
|
|
2300
|
+
* ```
|
|
2301
|
+
*/
|
|
2302
|
+
get connected(): boolean;
|
|
2303
|
+
/**
|
|
2304
|
+
* Returns the current ConnectionStatus
|
|
2305
|
+
*
|
|
2306
|
+
* @example
|
|
2307
|
+
* ```ts
|
|
2308
|
+
* try {
|
|
2309
|
+
* const statusOfConnection = player.node.connectionStatus;
|
|
2310
|
+
* console.log("node's connection status is:", statusOfConnection)
|
|
2311
|
+
* } catch (error) {
|
|
2312
|
+
* console.error("no socket available?", error)
|
|
2313
|
+
* }
|
|
2314
|
+
* ```
|
|
2315
|
+
*/
|
|
2316
|
+
get connectionStatus(): string;
|
|
2223
2317
|
/**
|
|
2224
2318
|
* Create a new Node
|
|
2225
2319
|
* @param options Lavalink Node Options
|
|
@@ -2369,30 +2463,6 @@ declare class LavalinkNode {
|
|
|
2369
2463
|
* ```
|
|
2370
2464
|
*/
|
|
2371
2465
|
disconnect(disconnectReason?: DisconnectReasonsType): void;
|
|
2372
|
-
/**
|
|
2373
|
-
* Returns if connected to the Node.
|
|
2374
|
-
*
|
|
2375
|
-
* @example
|
|
2376
|
-
* ```ts
|
|
2377
|
-
* const isConnected = player.node.connected;
|
|
2378
|
-
* console.log("node is connected: ", isConnected ? "yes" : "no")
|
|
2379
|
-
* ```
|
|
2380
|
-
*/
|
|
2381
|
-
get connected(): boolean;
|
|
2382
|
-
/**
|
|
2383
|
-
* Returns the current ConnectionStatus
|
|
2384
|
-
*
|
|
2385
|
-
* @example
|
|
2386
|
-
* ```ts
|
|
2387
|
-
* try {
|
|
2388
|
-
* const statusOfConnection = player.node.connectionStatus;
|
|
2389
|
-
* console.log("node's connection status is:", statusOfConnection)
|
|
2390
|
-
* } catch (error) {
|
|
2391
|
-
* console.error("no socket available?", error)
|
|
2392
|
-
* }
|
|
2393
|
-
* ```
|
|
2394
|
-
*/
|
|
2395
|
-
get connectionStatus(): string;
|
|
2396
2466
|
/**
|
|
2397
2467
|
* Gets all Players of a Node
|
|
2398
2468
|
* @returns array of players inside of lavalink
|
|
@@ -2526,6 +2596,16 @@ declare class LavalinkNode {
|
|
|
2526
2596
|
* ```
|
|
2527
2597
|
*/
|
|
2528
2598
|
fetchStats(): Promise<BaseNodeStats>;
|
|
2599
|
+
/**
|
|
2600
|
+
* Request NodeLink connection metrics. https://nodelink.js.org/docs/differences#connection-metrics
|
|
2601
|
+
* @returns the connection metrics of the node
|
|
2602
|
+
*
|
|
2603
|
+
* @example
|
|
2604
|
+
* ```ts
|
|
2605
|
+
* const connectionMetrics = await player.node.fetchConnectionMetrics();
|
|
2606
|
+
* ```
|
|
2607
|
+
*/
|
|
2608
|
+
fetchConnectionMetrics(): Promise<NodeLinkConnectionMetrics>;
|
|
2529
2609
|
/**
|
|
2530
2610
|
* Request Lavalink version.
|
|
2531
2611
|
* @returns the current used lavalink version
|
|
@@ -3071,6 +3151,13 @@ interface ManagerOptions<CustomPlayerT extends Player = Player> {
|
|
|
3071
3151
|
linksBlacklist?: (RegExp | string)[];
|
|
3072
3152
|
/** If links should be allowed or not. If set to false, it will throw an error if a link was provided. */
|
|
3073
3153
|
linksAllowed?: boolean;
|
|
3154
|
+
/** If the library should automatically check something, on default everything is enabled */
|
|
3155
|
+
autoChecks?: {
|
|
3156
|
+
/** Wether or not the client should check if the requested source's plugin is available on the node. */
|
|
3157
|
+
pluginValidations?: boolean;
|
|
3158
|
+
/** Wether or not the client should check if the requested source is available on the node */
|
|
3159
|
+
sourcesValidations?: boolean;
|
|
3160
|
+
};
|
|
3074
3161
|
/** Advanced Options for the Library, which may or may not be "library breaking" */
|
|
3075
3162
|
advancedOptions?: {
|
|
3076
3163
|
/** Max duration for that the filter fix duration works (in ms) - default is 8mins */
|
|
@@ -3151,6 +3238,12 @@ declare class LavalinkManager<CustomPlayerT extends Player = Player> extends Eve
|
|
|
3151
3238
|
* @param options
|
|
3152
3239
|
*/
|
|
3153
3240
|
private validateOptions;
|
|
3241
|
+
/**
|
|
3242
|
+
* Emits a debug event to the LavalinkManager
|
|
3243
|
+
* @param name name of the event
|
|
3244
|
+
* @param eventData event data
|
|
3245
|
+
*/
|
|
3246
|
+
private _emitDebugEvent;
|
|
3154
3247
|
/**
|
|
3155
3248
|
* Create the Lavalink Manager
|
|
3156
3249
|
* @param options
|
|
@@ -3335,4 +3428,4 @@ declare const LavalinkPlugins: {
|
|
|
3335
3428
|
/** Lavalink Sources regexes for url validations */
|
|
3336
3429
|
declare const SourceLinksRegexes: Record<SourcesRegex, RegExp>;
|
|
3337
3430
|
|
|
3338
|
-
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, 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 };
|
|
3431
|
+
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 };
|