lavalink-client 2.4.1 → 2.4.2

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.
@@ -150,7 +150,7 @@ class FilterManager {
150
150
  sendData.equalizer = [...this.equalizerBands];
151
151
  if (sendData.equalizer.length === 0)
152
152
  delete sendData.equalizer;
153
- for (const key of [...Object.keys(sendData)]) {
153
+ for (const key of Object.keys(sendData)) {
154
154
  // delete disabled filters
155
155
  if (key === "pluginFilters") {
156
156
  // for(const key of [...Object.keys(sendData.pluginFilters)]) {
@@ -181,7 +181,7 @@ class FilterManager {
181
181
  this.filters.rotation = this.data.rotation.rotationHz !== 0;
182
182
  this.filters.vibrato = this.data.vibrato.frequency !== 0 || this.data.vibrato.depth !== 0;
183
183
  this.filters.tremolo = this.data.tremolo.frequency !== 0 || this.data.tremolo.depth !== 0;
184
- const lavalinkFilterData = (this.data.pluginFilters?.["lavalink-filter-plugin"] || { echo: { decay: this.data.pluginFilters?.echo?.decay && !this.data.pluginFilters?.echo?.echoLength ? this.data.pluginFilters.echo.decay : 0, delay: this.data.pluginFilters?.echo?.delay || 0 }, reverb: { gains: [], delays: [], ...((this.data.pluginFilters.reverb) || {}) } });
184
+ const lavalinkFilterData = (this.data.pluginFilters?.["lavalink-filter-plugin"] || { echo: { decay: this.data.pluginFilters?.echo?.decay && !this.data.pluginFilters?.echo?.echoLength ? this.data.pluginFilters.echo.decay : 0, delay: this.data.pluginFilters?.echo?.delay || 0 }, reverb: { gains: [], delays: [], ...(this.data.pluginFilters.reverb) } });
185
185
  this.filters.lavalinkFilterPlugin.echo = lavalinkFilterData.echo.decay !== 0 || lavalinkFilterData.echo.delay !== 0;
186
186
  this.filters.lavalinkFilterPlugin.reverb = lavalinkFilterData.reverb?.delays?.length !== 0 || lavalinkFilterData.reverb?.gains?.length !== 0;
187
187
  this.filters.lavalinkLavaDspxPlugin.highPass = Object.values(this.data.pluginFilters["high-pass"] || {}).length > 0;
@@ -811,7 +811,7 @@ class LavalinkNode {
811
811
  * @returns boolean
812
812
  */
813
813
  syncPlayerData(data, res) {
814
- if (typeof data === "object" && typeof data?.guildId === "string" && typeof data.playerOptions === "object" && Object.keys(data.playerOptions).length > 1) {
814
+ if (typeof data === "object" && typeof data?.guildId === "string" && typeof data.playerOptions === "object" && Object.keys(data.playerOptions).length > 0) {
815
815
  const player = this.NodeManager.LavalinkManager.getPlayer(data.guildId);
816
816
  if (!player)
817
817
  return;
@@ -837,7 +837,7 @@ class LavalinkNode {
837
837
  }
838
838
  }
839
839
  if (typeof data.playerOptions.filters !== "undefined") {
840
- const oldFilterTimescale = { ...(player.filterManager.data.timescale || {}) };
840
+ const oldFilterTimescale = { ...player.filterManager.data.timescale };
841
841
  Object.freeze(oldFilterTimescale);
842
842
  if (data.playerOptions.filters.timescale)
843
843
  player.filterManager.data.timescale = data.playerOptions.filters.timescale;
@@ -230,7 +230,7 @@ export interface NodeManagerEvents {
230
230
  * Aka for that you need to be able to save player data like vc channel + text channel in a db and then sync it again
231
231
  * @event Manager.nodeManager#nodeResumed
232
232
  */
233
- "resumed": (node: LavalinkNode, paylaod: {
233
+ "resumed": (node: LavalinkNode, payload: {
234
234
  resumed: true;
235
235
  sessionId: string;
236
236
  op: "ready";
@@ -37,7 +37,7 @@ class ManagerUtils {
37
37
  buildPluginInfo(data, clientData = {}) {
38
38
  return {
39
39
  clientData: clientData,
40
- ...(data.pluginInfo || data.plugin || {})
40
+ ...(data.pluginInfo || data.plugin),
41
41
  };
42
42
  }
43
43
  buildTrack(data, requester) {
@@ -67,7 +67,7 @@ class ManagerUtils {
67
67
  isrc: data.info.isrc,
68
68
  },
69
69
  userData: {
70
- ...(data.userData || {}),
70
+ ...data.userData,
71
71
  requester: transformedRequester
72
72
  },
73
73
  pluginInfo: this.buildPluginInfo(data, "clientData" in data ? data.clientData : {}),
@@ -147,7 +147,7 @@ export class FilterManager {
147
147
  sendData.equalizer = [...this.equalizerBands];
148
148
  if (sendData.equalizer.length === 0)
149
149
  delete sendData.equalizer;
150
- for (const key of [...Object.keys(sendData)]) {
150
+ for (const key of Object.keys(sendData)) {
151
151
  // delete disabled filters
152
152
  if (key === "pluginFilters") {
153
153
  // for(const key of [...Object.keys(sendData.pluginFilters)]) {
@@ -178,7 +178,7 @@ export class FilterManager {
178
178
  this.filters.rotation = this.data.rotation.rotationHz !== 0;
179
179
  this.filters.vibrato = this.data.vibrato.frequency !== 0 || this.data.vibrato.depth !== 0;
180
180
  this.filters.tremolo = this.data.tremolo.frequency !== 0 || this.data.tremolo.depth !== 0;
181
- const lavalinkFilterData = (this.data.pluginFilters?.["lavalink-filter-plugin"] || { echo: { decay: this.data.pluginFilters?.echo?.decay && !this.data.pluginFilters?.echo?.echoLength ? this.data.pluginFilters.echo.decay : 0, delay: this.data.pluginFilters?.echo?.delay || 0 }, reverb: { gains: [], delays: [], ...((this.data.pluginFilters.reverb) || {}) } });
181
+ const lavalinkFilterData = (this.data.pluginFilters?.["lavalink-filter-plugin"] || { echo: { decay: this.data.pluginFilters?.echo?.decay && !this.data.pluginFilters?.echo?.echoLength ? this.data.pluginFilters.echo.decay : 0, delay: this.data.pluginFilters?.echo?.delay || 0 }, reverb: { gains: [], delays: [], ...(this.data.pluginFilters.reverb) } });
182
182
  this.filters.lavalinkFilterPlugin.echo = lavalinkFilterData.echo.decay !== 0 || lavalinkFilterData.echo.delay !== 0;
183
183
  this.filters.lavalinkFilterPlugin.reverb = lavalinkFilterData.reverb?.delays?.length !== 0 || lavalinkFilterData.reverb?.gains?.length !== 0;
184
184
  this.filters.lavalinkLavaDspxPlugin.highPass = Object.values(this.data.pluginFilters["high-pass"] || {}).length > 0;
@@ -807,7 +807,7 @@ export class LavalinkNode {
807
807
  * @returns boolean
808
808
  */
809
809
  syncPlayerData(data, res) {
810
- if (typeof data === "object" && typeof data?.guildId === "string" && typeof data.playerOptions === "object" && Object.keys(data.playerOptions).length > 1) {
810
+ if (typeof data === "object" && typeof data?.guildId === "string" && typeof data.playerOptions === "object" && Object.keys(data.playerOptions).length > 0) {
811
811
  const player = this.NodeManager.LavalinkManager.getPlayer(data.guildId);
812
812
  if (!player)
813
813
  return;
@@ -833,7 +833,7 @@ export class LavalinkNode {
833
833
  }
834
834
  }
835
835
  if (typeof data.playerOptions.filters !== "undefined") {
836
- const oldFilterTimescale = { ...(player.filterManager.data.timescale || {}) };
836
+ const oldFilterTimescale = { ...player.filterManager.data.timescale };
837
837
  Object.freeze(oldFilterTimescale);
838
838
  if (data.playerOptions.filters.timescale)
839
839
  player.filterManager.data.timescale = data.playerOptions.filters.timescale;
@@ -230,7 +230,7 @@ export interface NodeManagerEvents {
230
230
  * Aka for that you need to be able to save player data like vc channel + text channel in a db and then sync it again
231
231
  * @event Manager.nodeManager#nodeResumed
232
232
  */
233
- "resumed": (node: LavalinkNode, paylaod: {
233
+ "resumed": (node: LavalinkNode, payload: {
234
234
  resumed: true;
235
235
  sessionId: string;
236
236
  op: "ready";
@@ -32,7 +32,7 @@ export class ManagerUtils {
32
32
  buildPluginInfo(data, clientData = {}) {
33
33
  return {
34
34
  clientData: clientData,
35
- ...(data.pluginInfo || data.plugin || {})
35
+ ...(data.pluginInfo || data.plugin),
36
36
  };
37
37
  }
38
38
  buildTrack(data, requester) {
@@ -62,7 +62,7 @@ export class ManagerUtils {
62
62
  isrc: data.info.isrc,
63
63
  },
64
64
  userData: {
65
- ...(data.userData || {}),
65
+ ...data.userData,
66
66
  requester: transformedRequester
67
67
  },
68
68
  pluginInfo: this.buildPluginInfo(data, "clientData" in data ? data.clientData : {}),
@@ -230,7 +230,7 @@ export interface NodeManagerEvents {
230
230
  * Aka for that you need to be able to save player data like vc channel + text channel in a db and then sync it again
231
231
  * @event Manager.nodeManager#nodeResumed
232
232
  */
233
- "resumed": (node: LavalinkNode, paylaod: {
233
+ "resumed": (node: LavalinkNode, payload: {
234
234
  resumed: true;
235
235
  sessionId: string;
236
236
  op: "ready";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lavalink-client",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",