lavalink-client 2.7.4 → 2.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts 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
@@ -2189,7 +2207,6 @@ declare enum ReconnectionState {
2189
2207
  declare class LavalinkNode {
2190
2208
  private heartBeatPingTimestamp;
2191
2209
  private heartBeatPongTimestamp;
2192
- get heartBeatPing(): number;
2193
2210
  private heartBeatInterval?;
2194
2211
  private pingTimeout?;
2195
2212
  isAlive: boolean;
@@ -2220,6 +2237,52 @@ declare class LavalinkNode {
2220
2237
  private socket;
2221
2238
  /** Version of what the Lavalink Server should be */
2222
2239
  private version;
2240
+ /**
2241
+ * Returns the LavalinkManager of the Node
2242
+ */
2243
+ private get _LManager();
2244
+ /**
2245
+ * Returns the Heartbeat Ping of the Node
2246
+ */
2247
+ get heartBeatPing(): number;
2248
+ /**
2249
+ * Returns wether the plugin validations are enabled or not
2250
+ */
2251
+ private get _checkForPlugins();
2252
+ /**
2253
+ * Returns wether the source validations are enabled or not
2254
+ */
2255
+ private get _checkForSources();
2256
+ /**
2257
+ * Emits a debug event to the LavalinkManager
2258
+ * @param name name of the event
2259
+ * @param eventData event data
2260
+ */
2261
+ private _emitDebugEvent;
2262
+ /**
2263
+ * Returns if connected to the Node.
2264
+ *
2265
+ * @example
2266
+ * ```ts
2267
+ * const isConnected = player.node.connected;
2268
+ * console.log("node is connected: ", isConnected ? "yes" : "no")
2269
+ * ```
2270
+ */
2271
+ get connected(): boolean;
2272
+ /**
2273
+ * Returns the current ConnectionStatus
2274
+ *
2275
+ * @example
2276
+ * ```ts
2277
+ * try {
2278
+ * const statusOfConnection = player.node.connectionStatus;
2279
+ * console.log("node's connection status is:", statusOfConnection)
2280
+ * } catch (error) {
2281
+ * console.error("no socket available?", error)
2282
+ * }
2283
+ * ```
2284
+ */
2285
+ get connectionStatus(): string;
2223
2286
  /**
2224
2287
  * Create a new Node
2225
2288
  * @param options Lavalink Node Options
@@ -2369,30 +2432,6 @@ declare class LavalinkNode {
2369
2432
  * ```
2370
2433
  */
2371
2434
  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
2435
  /**
2397
2436
  * Gets all Players of a Node
2398
2437
  * @returns array of players inside of lavalink
@@ -3071,6 +3110,13 @@ interface ManagerOptions<CustomPlayerT extends Player = Player> {
3071
3110
  linksBlacklist?: (RegExp | string)[];
3072
3111
  /** If links should be allowed or not. If set to false, it will throw an error if a link was provided. */
3073
3112
  linksAllowed?: boolean;
3113
+ /** If the library should automatically check something, on default everything is enabled */
3114
+ autoChecks?: {
3115
+ /** Wether or not the client should check if the requested source's plugin is available on the node. */
3116
+ pluginValidations?: boolean;
3117
+ /** Wether or not the client should check if the requested source is available on the node */
3118
+ sourcesValidations?: boolean;
3119
+ };
3074
3120
  /** Advanced Options for the Library, which may or may not be "library breaking" */
3075
3121
  advancedOptions?: {
3076
3122
  /** Max duration for that the filter fix duration works (in ms) - default is 8mins */
@@ -3151,6 +3197,12 @@ declare class LavalinkManager<CustomPlayerT extends Player = Player> extends Eve
3151
3197
  * @param options
3152
3198
  */
3153
3199
  private validateOptions;
3200
+ /**
3201
+ * Emits a debug event to the LavalinkManager
3202
+ * @param name name of the event
3203
+ * @param eventData event data
3204
+ */
3205
+ private _emitDebugEvent;
3154
3206
  /**
3155
3207
  * Create the Lavalink Manager
3156
3208
  * @param options
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
@@ -2189,7 +2207,6 @@ declare enum ReconnectionState {
2189
2207
  declare class LavalinkNode {
2190
2208
  private heartBeatPingTimestamp;
2191
2209
  private heartBeatPongTimestamp;
2192
- get heartBeatPing(): number;
2193
2210
  private heartBeatInterval?;
2194
2211
  private pingTimeout?;
2195
2212
  isAlive: boolean;
@@ -2220,6 +2237,52 @@ declare class LavalinkNode {
2220
2237
  private socket;
2221
2238
  /** Version of what the Lavalink Server should be */
2222
2239
  private version;
2240
+ /**
2241
+ * Returns the LavalinkManager of the Node
2242
+ */
2243
+ private get _LManager();
2244
+ /**
2245
+ * Returns the Heartbeat Ping of the Node
2246
+ */
2247
+ get heartBeatPing(): number;
2248
+ /**
2249
+ * Returns wether the plugin validations are enabled or not
2250
+ */
2251
+ private get _checkForPlugins();
2252
+ /**
2253
+ * Returns wether the source validations are enabled or not
2254
+ */
2255
+ private get _checkForSources();
2256
+ /**
2257
+ * Emits a debug event to the LavalinkManager
2258
+ * @param name name of the event
2259
+ * @param eventData event data
2260
+ */
2261
+ private _emitDebugEvent;
2262
+ /**
2263
+ * Returns if connected to the Node.
2264
+ *
2265
+ * @example
2266
+ * ```ts
2267
+ * const isConnected = player.node.connected;
2268
+ * console.log("node is connected: ", isConnected ? "yes" : "no")
2269
+ * ```
2270
+ */
2271
+ get connected(): boolean;
2272
+ /**
2273
+ * Returns the current ConnectionStatus
2274
+ *
2275
+ * @example
2276
+ * ```ts
2277
+ * try {
2278
+ * const statusOfConnection = player.node.connectionStatus;
2279
+ * console.log("node's connection status is:", statusOfConnection)
2280
+ * } catch (error) {
2281
+ * console.error("no socket available?", error)
2282
+ * }
2283
+ * ```
2284
+ */
2285
+ get connectionStatus(): string;
2223
2286
  /**
2224
2287
  * Create a new Node
2225
2288
  * @param options Lavalink Node Options
@@ -2369,30 +2432,6 @@ declare class LavalinkNode {
2369
2432
  * ```
2370
2433
  */
2371
2434
  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
2435
  /**
2397
2436
  * Gets all Players of a Node
2398
2437
  * @returns array of players inside of lavalink
@@ -3071,6 +3110,13 @@ interface ManagerOptions<CustomPlayerT extends Player = Player> {
3071
3110
  linksBlacklist?: (RegExp | string)[];
3072
3111
  /** If links should be allowed or not. If set to false, it will throw an error if a link was provided. */
3073
3112
  linksAllowed?: boolean;
3113
+ /** If the library should automatically check something, on default everything is enabled */
3114
+ autoChecks?: {
3115
+ /** Wether or not the client should check if the requested source's plugin is available on the node. */
3116
+ pluginValidations?: boolean;
3117
+ /** Wether or not the client should check if the requested source is available on the node */
3118
+ sourcesValidations?: boolean;
3119
+ };
3074
3120
  /** Advanced Options for the Library, which may or may not be "library breaking" */
3075
3121
  advancedOptions?: {
3076
3122
  /** Max duration for that the filter fix duration works (in ms) - default is 8mins */
@@ -3151,6 +3197,12 @@ declare class LavalinkManager<CustomPlayerT extends Player = Player> extends Eve
3151
3197
  * @param options
3152
3198
  */
3153
3199
  private validateOptions;
3200
+ /**
3201
+ * Emits a debug event to the LavalinkManager
3202
+ * @param name name of the event
3203
+ * @param eventData event data
3204
+ */
3205
+ private _emitDebugEvent;
3154
3206
  /**
3155
3207
  * Create the Lavalink Manager
3156
3208
  * @param options