lavalink-client 2.9.6 → 2.9.8

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.cjs CHANGED
@@ -2000,6 +2000,7 @@ var LavalinkNode = class _LavalinkNode {
2000
2000
  /**
2001
2001
  * subscribe to lyrics updates for a guild
2002
2002
  * @param guildId the guild id of the player
2003
+ * @param skipTrackSource wether to skip the track source or not
2003
2004
  * @returns request data of the request
2004
2005
  *
2005
2006
  * @example
@@ -2009,15 +2010,18 @@ var LavalinkNode = class _LavalinkNode {
2009
2010
  * // const lyrics = await player.subscribeLyrics();
2010
2011
  * ```
2011
2012
  */
2012
- subscribe: async (guildId) => {
2013
+ subscribe: async (guildId, skipTrackSource) => {
2013
2014
  if (!this.sessionId) throw new Error("the Lavalink-Node is either not ready, or not up to date!");
2014
2015
  if (this._checkForPlugins && !this.info?.plugins?.find?.((v) => v.name === "lavalyrics-plugin"))
2015
2016
  throw new RangeError(
2016
2017
  `there is no lavalyrics-plugin available in the lavalink node (required for lyrics): ${this.id}`
2017
2018
  );
2018
- return await this.request(`/sessions/${this.sessionId}/players/${guildId}/lyrics/subscribe`, (options) => {
2019
- options.method = "POST";
2020
- });
2019
+ return await this.request(
2020
+ `/sessions/${this.sessionId}/players/${guildId}/lyrics/subscribe?skipTrackSource=${skipTrackSource ?? false}`,
2021
+ (options) => {
2022
+ options.method = "POST";
2023
+ }
2024
+ );
2021
2025
  },
2022
2026
  /**
2023
2027
  * unsubscribe from lyrics updates for a guild
@@ -2410,7 +2414,7 @@ var LavalinkNode = class _LavalinkNode {
2410
2414
  player.filterManager.checkFiltersState(oldFilterTimescale);
2411
2415
  }
2412
2416
  }
2413
- if (res?.guildId === "string" && typeof res?.voice !== "undefined") {
2417
+ if (typeof res?.guildId === "string" && typeof res?.voice !== "undefined") {
2414
2418
  const player = this._LManager.getPlayer(data.guildId);
2415
2419
  if (!player) return;
2416
2420
  if (typeof res?.voice?.connected === "boolean" && res.voice.connected === false) {
@@ -5375,21 +5379,48 @@ var Player = class {
5375
5379
  );
5376
5380
  }
5377
5381
  /**
5378
- * Set custom data.
5382
+ * Set custom data. (Deprecated - Use Player#setData instead.)
5379
5383
  * @param key
5380
5384
  * @param value
5385
+ * @deprecated Use Player#setData instead.
5381
5386
  */
5382
5387
  set(key, value) {
5383
5388
  this.data[key] = value;
5384
5389
  return this;
5385
5390
  }
5386
5391
  /**
5387
- * Get custom data.
5392
+ * Get custom data. (Deprecated - Use Player#getData instead.)
5388
5393
  * @param key
5394
+ * @deprecated Use Player#getData instead.
5389
5395
  */
5390
5396
  get(key) {
5391
5397
  return this.data[key];
5392
5398
  }
5399
+ /**
5400
+ * Set custom data.
5401
+ * @param key
5402
+ * @param value
5403
+ */
5404
+ setData(key, value) {
5405
+ this.data[key] = value;
5406
+ return this;
5407
+ }
5408
+ /**
5409
+ * Get custom data.
5410
+ * @param key
5411
+ */
5412
+ getData(key) {
5413
+ return this.data[key];
5414
+ }
5415
+ /**
5416
+ * Delete specific custom data.
5417
+ * @param key
5418
+ */
5419
+ deleteData(key) {
5420
+ if (key.startsWith("internal_")) return this;
5421
+ delete this.data[key];
5422
+ return this;
5423
+ }
5393
5424
  /**
5394
5425
  * CLears all the custom data.
5395
5426
  */
@@ -5915,15 +5946,16 @@ var Player = class {
5915
5946
  return await this.node.lyrics.get(track, skipTrackSource);
5916
5947
  }
5917
5948
  /**
5918
- * Subscribe to the lyrics event on a specific guild to active live lyrics events
5949
+ * Subscribe to the lyrics event on a specific guild to active live lyrics events}
5950
+ * @param skipTrackSource If true, it will not try to get the lyrics from the track source
5919
5951
  * @returns The unsubscribe function
5920
5952
  * @example
5921
5953
  * ```ts
5922
5954
  * const lyrics = await player.subscribeLyrics();
5923
5955
  * ```
5924
5956
  */
5925
- subscribeLyrics() {
5926
- return this.node.lyrics.subscribe(this.guildId);
5957
+ subscribeLyrics(skipTrackSource) {
5958
+ return this.node.lyrics.subscribe(this.guildId, skipTrackSource);
5927
5959
  }
5928
5960
  /**
5929
5961
  * Unsubscribe from the lyrics event on a specific guild to disable live lyrics events
package/dist/index.d.cts CHANGED
@@ -2680,16 +2680,34 @@ declare class Player {
2680
2680
  */
2681
2681
  constructor(options: PlayerOptions, LavalinkManager: LavalinkManager, dontEmitPlayerCreateEvent?: boolean);
2682
2682
  /**
2683
- * Set custom data.
2683
+ * Set custom data. (Deprecated - Use Player#setData instead.)
2684
2684
  * @param key
2685
2685
  * @param value
2686
+ * @deprecated Use Player#setData instead.
2686
2687
  */
2687
2688
  set(key: string, value: unknown): this;
2688
2689
  /**
2689
- * Get custom data.
2690
+ * Get custom data. (Deprecated - Use Player#getData instead.)
2690
2691
  * @param key
2692
+ * @deprecated Use Player#getData instead.
2691
2693
  */
2692
2694
  get<T>(key: string): T;
2695
+ /**
2696
+ * Set custom data.
2697
+ * @param key
2698
+ * @param value
2699
+ */
2700
+ setData(key: string, value: unknown): this;
2701
+ /**
2702
+ * Get custom data.
2703
+ * @param key
2704
+ */
2705
+ getData<T>(key: string): T;
2706
+ /**
2707
+ * Delete specific custom data.
2708
+ * @param key
2709
+ */
2710
+ deleteData(key: string): this;
2693
2711
  /**
2694
2712
  * CLears all the custom data.
2695
2713
  */
@@ -2815,14 +2833,15 @@ declare class Player {
2815
2833
  */
2816
2834
  getLyrics(track: Track, skipTrackSource?: boolean): Promise<LyricsResult>;
2817
2835
  /**
2818
- * Subscribe to the lyrics event on a specific guild to active live lyrics events
2836
+ * Subscribe to the lyrics event on a specific guild to active live lyrics events}
2837
+ * @param skipTrackSource If true, it will not try to get the lyrics from the track source
2819
2838
  * @returns The unsubscribe function
2820
2839
  * @example
2821
2840
  * ```ts
2822
2841
  * const lyrics = await player.subscribeLyrics();
2823
2842
  * ```
2824
2843
  */
2825
- subscribeLyrics(): Promise<unknown>;
2844
+ subscribeLyrics(skipTrackSource?: boolean): Promise<unknown>;
2826
2845
  /**
2827
2846
  * Unsubscribe from the lyrics event on a specific guild to disable live lyrics events
2828
2847
  * @returns The unsubscribe function
@@ -3344,6 +3363,7 @@ declare class LavalinkNode {
3344
3363
  /**
3345
3364
  * subscribe to lyrics updates for a guild
3346
3365
  * @param guildId the guild id of the player
3366
+ * @param skipTrackSource wether to skip the track source or not
3347
3367
  * @returns request data of the request
3348
3368
  *
3349
3369
  * @example
@@ -3353,7 +3373,7 @@ declare class LavalinkNode {
3353
3373
  * // const lyrics = await player.subscribeLyrics();
3354
3374
  * ```
3355
3375
  */
3356
- subscribe: (guildId: string) => Promise<unknown>;
3376
+ subscribe: (guildId: string, skipTrackSource?: boolean) => Promise<unknown>;
3357
3377
  /**
3358
3378
  * unsubscribe from lyrics updates for a guild
3359
3379
  * @param guildId the guild id of the player
package/dist/index.d.ts CHANGED
@@ -2680,16 +2680,34 @@ declare class Player {
2680
2680
  */
2681
2681
  constructor(options: PlayerOptions, LavalinkManager: LavalinkManager, dontEmitPlayerCreateEvent?: boolean);
2682
2682
  /**
2683
- * Set custom data.
2683
+ * Set custom data. (Deprecated - Use Player#setData instead.)
2684
2684
  * @param key
2685
2685
  * @param value
2686
+ * @deprecated Use Player#setData instead.
2686
2687
  */
2687
2688
  set(key: string, value: unknown): this;
2688
2689
  /**
2689
- * Get custom data.
2690
+ * Get custom data. (Deprecated - Use Player#getData instead.)
2690
2691
  * @param key
2692
+ * @deprecated Use Player#getData instead.
2691
2693
  */
2692
2694
  get<T>(key: string): T;
2695
+ /**
2696
+ * Set custom data.
2697
+ * @param key
2698
+ * @param value
2699
+ */
2700
+ setData(key: string, value: unknown): this;
2701
+ /**
2702
+ * Get custom data.
2703
+ * @param key
2704
+ */
2705
+ getData<T>(key: string): T;
2706
+ /**
2707
+ * Delete specific custom data.
2708
+ * @param key
2709
+ */
2710
+ deleteData(key: string): this;
2693
2711
  /**
2694
2712
  * CLears all the custom data.
2695
2713
  */
@@ -2815,14 +2833,15 @@ declare class Player {
2815
2833
  */
2816
2834
  getLyrics(track: Track, skipTrackSource?: boolean): Promise<LyricsResult>;
2817
2835
  /**
2818
- * Subscribe to the lyrics event on a specific guild to active live lyrics events
2836
+ * Subscribe to the lyrics event on a specific guild to active live lyrics events}
2837
+ * @param skipTrackSource If true, it will not try to get the lyrics from the track source
2819
2838
  * @returns The unsubscribe function
2820
2839
  * @example
2821
2840
  * ```ts
2822
2841
  * const lyrics = await player.subscribeLyrics();
2823
2842
  * ```
2824
2843
  */
2825
- subscribeLyrics(): Promise<unknown>;
2844
+ subscribeLyrics(skipTrackSource?: boolean): Promise<unknown>;
2826
2845
  /**
2827
2846
  * Unsubscribe from the lyrics event on a specific guild to disable live lyrics events
2828
2847
  * @returns The unsubscribe function
@@ -3344,6 +3363,7 @@ declare class LavalinkNode {
3344
3363
  /**
3345
3364
  * subscribe to lyrics updates for a guild
3346
3365
  * @param guildId the guild id of the player
3366
+ * @param skipTrackSource wether to skip the track source or not
3347
3367
  * @returns request data of the request
3348
3368
  *
3349
3369
  * @example
@@ -3353,7 +3373,7 @@ declare class LavalinkNode {
3353
3373
  * // const lyrics = await player.subscribeLyrics();
3354
3374
  * ```
3355
3375
  */
3356
- subscribe: (guildId: string) => Promise<unknown>;
3376
+ subscribe: (guildId: string, skipTrackSource?: boolean) => Promise<unknown>;
3357
3377
  /**
3358
3378
  * unsubscribe from lyrics updates for a guild
3359
3379
  * @param guildId the guild id of the player
package/dist/index.js CHANGED
@@ -1936,6 +1936,7 @@ var LavalinkNode = class _LavalinkNode {
1936
1936
  /**
1937
1937
  * subscribe to lyrics updates for a guild
1938
1938
  * @param guildId the guild id of the player
1939
+ * @param skipTrackSource wether to skip the track source or not
1939
1940
  * @returns request data of the request
1940
1941
  *
1941
1942
  * @example
@@ -1945,15 +1946,18 @@ var LavalinkNode = class _LavalinkNode {
1945
1946
  * // const lyrics = await player.subscribeLyrics();
1946
1947
  * ```
1947
1948
  */
1948
- subscribe: async (guildId) => {
1949
+ subscribe: async (guildId, skipTrackSource) => {
1949
1950
  if (!this.sessionId) throw new Error("the Lavalink-Node is either not ready, or not up to date!");
1950
1951
  if (this._checkForPlugins && !this.info?.plugins?.find?.((v) => v.name === "lavalyrics-plugin"))
1951
1952
  throw new RangeError(
1952
1953
  `there is no lavalyrics-plugin available in the lavalink node (required for lyrics): ${this.id}`
1953
1954
  );
1954
- return await this.request(`/sessions/${this.sessionId}/players/${guildId}/lyrics/subscribe`, (options) => {
1955
- options.method = "POST";
1956
- });
1955
+ return await this.request(
1956
+ `/sessions/${this.sessionId}/players/${guildId}/lyrics/subscribe?skipTrackSource=${skipTrackSource ?? false}`,
1957
+ (options) => {
1958
+ options.method = "POST";
1959
+ }
1960
+ );
1957
1961
  },
1958
1962
  /**
1959
1963
  * unsubscribe from lyrics updates for a guild
@@ -2346,7 +2350,7 @@ var LavalinkNode = class _LavalinkNode {
2346
2350
  player.filterManager.checkFiltersState(oldFilterTimescale);
2347
2351
  }
2348
2352
  }
2349
- if (res?.guildId === "string" && typeof res?.voice !== "undefined") {
2353
+ if (typeof res?.guildId === "string" && typeof res?.voice !== "undefined") {
2350
2354
  const player = this._LManager.getPlayer(data.guildId);
2351
2355
  if (!player) return;
2352
2356
  if (typeof res?.voice?.connected === "boolean" && res.voice.connected === false) {
@@ -5311,21 +5315,48 @@ var Player = class {
5311
5315
  );
5312
5316
  }
5313
5317
  /**
5314
- * Set custom data.
5318
+ * Set custom data. (Deprecated - Use Player#setData instead.)
5315
5319
  * @param key
5316
5320
  * @param value
5321
+ * @deprecated Use Player#setData instead.
5317
5322
  */
5318
5323
  set(key, value) {
5319
5324
  this.data[key] = value;
5320
5325
  return this;
5321
5326
  }
5322
5327
  /**
5323
- * Get custom data.
5328
+ * Get custom data. (Deprecated - Use Player#getData instead.)
5324
5329
  * @param key
5330
+ * @deprecated Use Player#getData instead.
5325
5331
  */
5326
5332
  get(key) {
5327
5333
  return this.data[key];
5328
5334
  }
5335
+ /**
5336
+ * Set custom data.
5337
+ * @param key
5338
+ * @param value
5339
+ */
5340
+ setData(key, value) {
5341
+ this.data[key] = value;
5342
+ return this;
5343
+ }
5344
+ /**
5345
+ * Get custom data.
5346
+ * @param key
5347
+ */
5348
+ getData(key) {
5349
+ return this.data[key];
5350
+ }
5351
+ /**
5352
+ * Delete specific custom data.
5353
+ * @param key
5354
+ */
5355
+ deleteData(key) {
5356
+ if (key.startsWith("internal_")) return this;
5357
+ delete this.data[key];
5358
+ return this;
5359
+ }
5329
5360
  /**
5330
5361
  * CLears all the custom data.
5331
5362
  */
@@ -5851,15 +5882,16 @@ var Player = class {
5851
5882
  return await this.node.lyrics.get(track, skipTrackSource);
5852
5883
  }
5853
5884
  /**
5854
- * Subscribe to the lyrics event on a specific guild to active live lyrics events
5885
+ * Subscribe to the lyrics event on a specific guild to active live lyrics events}
5886
+ * @param skipTrackSource If true, it will not try to get the lyrics from the track source
5855
5887
  * @returns The unsubscribe function
5856
5888
  * @example
5857
5889
  * ```ts
5858
5890
  * const lyrics = await player.subscribeLyrics();
5859
5891
  * ```
5860
5892
  */
5861
- subscribeLyrics() {
5862
- return this.node.lyrics.subscribe(this.guildId);
5893
+ subscribeLyrics(skipTrackSource) {
5894
+ return this.node.lyrics.subscribe(this.guildId, skipTrackSource);
5863
5895
  }
5864
5896
  /**
5865
5897
  * Unsubscribe from the lyrics event on a specific guild to disable live lyrics events
package/dist/index.mjs CHANGED
@@ -1936,6 +1936,7 @@ var LavalinkNode = class _LavalinkNode {
1936
1936
  /**
1937
1937
  * subscribe to lyrics updates for a guild
1938
1938
  * @param guildId the guild id of the player
1939
+ * @param skipTrackSource wether to skip the track source or not
1939
1940
  * @returns request data of the request
1940
1941
  *
1941
1942
  * @example
@@ -1945,15 +1946,18 @@ var LavalinkNode = class _LavalinkNode {
1945
1946
  * // const lyrics = await player.subscribeLyrics();
1946
1947
  * ```
1947
1948
  */
1948
- subscribe: async (guildId) => {
1949
+ subscribe: async (guildId, skipTrackSource) => {
1949
1950
  if (!this.sessionId) throw new Error("the Lavalink-Node is either not ready, or not up to date!");
1950
1951
  if (this._checkForPlugins && !this.info?.plugins?.find?.((v) => v.name === "lavalyrics-plugin"))
1951
1952
  throw new RangeError(
1952
1953
  `there is no lavalyrics-plugin available in the lavalink node (required for lyrics): ${this.id}`
1953
1954
  );
1954
- return await this.request(`/sessions/${this.sessionId}/players/${guildId}/lyrics/subscribe`, (options) => {
1955
- options.method = "POST";
1956
- });
1955
+ return await this.request(
1956
+ `/sessions/${this.sessionId}/players/${guildId}/lyrics/subscribe?skipTrackSource=${skipTrackSource ?? false}`,
1957
+ (options) => {
1958
+ options.method = "POST";
1959
+ }
1960
+ );
1957
1961
  },
1958
1962
  /**
1959
1963
  * unsubscribe from lyrics updates for a guild
@@ -2346,7 +2350,7 @@ var LavalinkNode = class _LavalinkNode {
2346
2350
  player.filterManager.checkFiltersState(oldFilterTimescale);
2347
2351
  }
2348
2352
  }
2349
- if (res?.guildId === "string" && typeof res?.voice !== "undefined") {
2353
+ if (typeof res?.guildId === "string" && typeof res?.voice !== "undefined") {
2350
2354
  const player = this._LManager.getPlayer(data.guildId);
2351
2355
  if (!player) return;
2352
2356
  if (typeof res?.voice?.connected === "boolean" && res.voice.connected === false) {
@@ -5311,21 +5315,48 @@ var Player = class {
5311
5315
  );
5312
5316
  }
5313
5317
  /**
5314
- * Set custom data.
5318
+ * Set custom data. (Deprecated - Use Player#setData instead.)
5315
5319
  * @param key
5316
5320
  * @param value
5321
+ * @deprecated Use Player#setData instead.
5317
5322
  */
5318
5323
  set(key, value) {
5319
5324
  this.data[key] = value;
5320
5325
  return this;
5321
5326
  }
5322
5327
  /**
5323
- * Get custom data.
5328
+ * Get custom data. (Deprecated - Use Player#getData instead.)
5324
5329
  * @param key
5330
+ * @deprecated Use Player#getData instead.
5325
5331
  */
5326
5332
  get(key) {
5327
5333
  return this.data[key];
5328
5334
  }
5335
+ /**
5336
+ * Set custom data.
5337
+ * @param key
5338
+ * @param value
5339
+ */
5340
+ setData(key, value) {
5341
+ this.data[key] = value;
5342
+ return this;
5343
+ }
5344
+ /**
5345
+ * Get custom data.
5346
+ * @param key
5347
+ */
5348
+ getData(key) {
5349
+ return this.data[key];
5350
+ }
5351
+ /**
5352
+ * Delete specific custom data.
5353
+ * @param key
5354
+ */
5355
+ deleteData(key) {
5356
+ if (key.startsWith("internal_")) return this;
5357
+ delete this.data[key];
5358
+ return this;
5359
+ }
5329
5360
  /**
5330
5361
  * CLears all the custom data.
5331
5362
  */
@@ -5851,15 +5882,16 @@ var Player = class {
5851
5882
  return await this.node.lyrics.get(track, skipTrackSource);
5852
5883
  }
5853
5884
  /**
5854
- * Subscribe to the lyrics event on a specific guild to active live lyrics events
5885
+ * Subscribe to the lyrics event on a specific guild to active live lyrics events}
5886
+ * @param skipTrackSource If true, it will not try to get the lyrics from the track source
5855
5887
  * @returns The unsubscribe function
5856
5888
  * @example
5857
5889
  * ```ts
5858
5890
  * const lyrics = await player.subscribeLyrics();
5859
5891
  * ```
5860
5892
  */
5861
- subscribeLyrics() {
5862
- return this.node.lyrics.subscribe(this.guildId);
5893
+ subscribeLyrics(skipTrackSource) {
5894
+ return this.node.lyrics.subscribe(this.guildId, skipTrackSource);
5863
5895
  }
5864
5896
  /**
5865
5897
  * Unsubscribe from the lyrics event on a specific guild to disable live lyrics events
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lavalink-client",
3
- "version": "2.9.6",
3
+ "version": "2.9.8",
4
4
  "description": "Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients. - Supports NodeLink@v3 too.",
5
5
  "keywords": [
6
6
  "advanced",