lavalink-client 2.9.5 → 2.9.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.cjs CHANGED
@@ -6110,7 +6110,7 @@ var Player = class {
6110
6110
  };
6111
6111
 
6112
6112
  // src/structures/LavalinkManager.ts
6113
- var LavalinkManager = class extends import_node_events2.EventEmitter {
6113
+ var LavalinkManager = class _LavalinkManager extends import_node_events2.EventEmitter {
6114
6114
  /**
6115
6115
  * Emit an event
6116
6116
  * @param event The event to emit
@@ -6279,6 +6279,17 @@ var LavalinkManager = class extends import_node_events2.EventEmitter {
6279
6279
  if (!this.options?.advancedOptions?.enableDebugEvents) return;
6280
6280
  this.emit("debug", name, eventData);
6281
6281
  }
6282
+ static _noAudioDebugPrefix = "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, ";
6283
+ /**
6284
+ * Emits NoAudioDebug and optionally logs to console when debugOptions.noAudio is enabled.
6285
+ */
6286
+ _debugNoAudio(state, functionLayer, messages, ...consoleArgs) {
6287
+ this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, { state, functionLayer, message: messages.message });
6288
+ if (this.options?.advancedOptions?.debugOptions?.noAudio === true) {
6289
+ const consoleMsg = messages.consoleMessage ?? messages.message;
6290
+ console.debug(_LavalinkManager._noAudioDebugPrefix + consoleMsg, ...consoleArgs);
6291
+ }
6292
+ }
6282
6293
  /**
6283
6294
  * Create the Lavalink Manager
6284
6295
  * @param options
@@ -6510,28 +6521,22 @@ var LavalinkManager = class extends import_node_events2.EventEmitter {
6510
6521
  */
6511
6522
  async sendRawData(data) {
6512
6523
  if (!this.initiated) {
6513
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6514
- state: "log",
6524
+ this._debugNoAudio("log", "LavalinkManager > sendRawData()", {
6515
6525
  message: "Manager is not initated yet",
6516
- functionLayer: "LavalinkManager > sendRawData()"
6526
+ consoleMessage: "manager is not initated yet"
6517
6527
  });
6518
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6519
- console.debug(
6520
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, manager is not initated yet"
6521
- );
6522
6528
  return;
6523
6529
  }
6524
6530
  if (!("t" in data)) {
6525
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6526
- state: "error",
6527
- message: "No 't' in payload-data of the raw event:",
6528
- functionLayer: "LavalinkManager > sendRawData()"
6529
- });
6530
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6531
- console.debug(
6532
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, no 't' in payload-data of the raw event:",
6533
- data
6534
- );
6531
+ this._debugNoAudio(
6532
+ "error",
6533
+ "LavalinkManager > sendRawData()",
6534
+ {
6535
+ message: "No 't' in payload-data of the raw event:",
6536
+ consoleMessage: "no 't' in payload-data of the raw event:"
6537
+ },
6538
+ data
6539
+ );
6535
6540
  return;
6536
6541
  }
6537
6542
  if ("CHANNEL_DELETE" === data.t) {
@@ -6544,132 +6549,94 @@ var LavalinkManager = class extends import_node_events2.EventEmitter {
6544
6549
  if (["VOICE_STATE_UPDATE", "VOICE_SERVER_UPDATE"].includes(data.t)) {
6545
6550
  const update = "d" in data ? data.d : data;
6546
6551
  if (!update) {
6547
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6548
- state: "warn",
6549
- message: `No Update data found in payload :: ${safeStringify(data, 2)}`,
6550
- functionLayer: "LavalinkManager > sendRawData()"
6551
- });
6552
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6553
- console.debug(
6554
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, no update data found in payload:",
6555
- data
6556
- );
6552
+ this._debugNoAudio(
6553
+ "warn",
6554
+ "LavalinkManager > sendRawData()",
6555
+ {
6556
+ message: `No Update data found in payload :: ${safeStringify(data, 2)}`,
6557
+ consoleMessage: "no update data found in payload:"
6558
+ },
6559
+ data
6560
+ );
6557
6561
  return;
6558
6562
  }
6559
6563
  if (!("token" in update) && !("session_id" in update)) {
6560
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6561
- state: "error",
6562
- message: `No 'token' nor 'session_id' found in payload :: ${safeStringify(data, 2)}`,
6563
- functionLayer: "LavalinkManager > sendRawData()"
6564
- });
6565
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6566
- console.debug(
6567
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, no 'token' nor 'session_id' found in payload:",
6568
- data
6569
- );
6564
+ this._debugNoAudio(
6565
+ "error",
6566
+ "LavalinkManager > sendRawData()",
6567
+ {
6568
+ message: `No 'token' nor 'session_id' found in payload :: ${safeStringify(data, 2)}`,
6569
+ consoleMessage: "no 'token' nor 'session_id' found in payload:"
6570
+ },
6571
+ data
6572
+ );
6570
6573
  return;
6571
6574
  }
6572
6575
  const player = this.getPlayer(update.guild_id);
6573
6576
  if (!player) {
6574
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6575
- state: "warn",
6576
- message: `No Lavalink Player found via key: 'guild_id' of update-data :: ${safeStringify(update, 2)}`,
6577
- functionLayer: "LavalinkManager > sendRawData()"
6578
- });
6579
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6580
- console.debug(
6581
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, No Lavalink Player found via key: 'guild_id' of update-data:",
6582
- update
6583
- );
6577
+ this._debugNoAudio(
6578
+ "warn",
6579
+ "LavalinkManager > sendRawData()",
6580
+ {
6581
+ message: `No Lavalink Player found via key: 'guild_id' of update-data :: ${safeStringify(update, 2)}`,
6582
+ consoleMessage: "No Lavalink Player found via key: 'guild_id' of update-data:"
6583
+ },
6584
+ update
6585
+ );
6584
6586
  return;
6585
6587
  }
6586
6588
  if (player.get("internal_destroystatus") === true) {
6587
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6588
- state: "warn",
6589
- message: `Player is in a destroying state. can't signal the voice states`,
6590
- functionLayer: "LavalinkManager > sendRawData()"
6589
+ this._debugNoAudio("warn", "LavalinkManager > sendRawData()", {
6590
+ message: "Player is in a destroying state. can't signal the voice states"
6591
6591
  });
6592
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6593
- console.debug(
6594
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Player is in a destroying state. can't signal the voice states"
6595
- );
6596
6592
  return;
6597
6593
  }
6598
6594
  if ("token" in update) {
6599
6595
  if (!player.node?.sessionId) throw new Error("Lavalink Node is either not ready or not up to date");
6600
6596
  const sessionId2Use = player.voice?.sessionId || ("sessionId" in update ? update.sessionId : void 0);
6601
6597
  const channelId2Use = player.voice?.channelId || ("channel_id" in update ? update.channel_id : void 0);
6598
+ const voiceData = {
6599
+ token: update.token,
6600
+ endpoint: update.endpoint,
6601
+ sessionId: sessionId2Use,
6602
+ channelId: channelId2Use
6603
+ };
6602
6604
  if (!sessionId2Use) {
6603
- this.emit("debug", "NoAudioDebug" /* NoAudioDebug */, {
6604
- state: "error",
6605
- message: `Can't send updatePlayer for voice token session - Missing sessionId :: ${safeStringify({ voice: { token: update.token, endpoint: update.endpoint, sessionId: sessionId2Use, channelId: channelId2Use }, update, playerVoice: player.voice }, 2)}`,
6606
- functionLayer: "LavalinkManager > sendRawData()"
6607
- });
6608
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6609
- console.debug(
6610
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Can't send updatePlayer for voice token session - Missing sessionId",
6611
- {
6612
- voice: {
6613
- token: update.token,
6614
- endpoint: update.endpoint,
6615
- sessionId: sessionId2Use,
6616
- channelId: channelId2Use
6617
- },
6618
- update,
6619
- playerVoice: player.voice
6620
- }
6621
- );
6605
+ this._debugNoAudio(
6606
+ "error",
6607
+ "LavalinkManager > sendRawData()",
6608
+ {
6609
+ message: `Can't send updatePlayer for voice token session - Missing sessionId :: ${safeStringify({ voice: voiceData, update, playerVoice: player.voice }, 2)}`,
6610
+ consoleMessage: "Can't send updatePlayer for voice token session - Missing sessionId"
6611
+ },
6612
+ { voice: voiceData, update, playerVoice: player.voice }
6613
+ );
6622
6614
  } else if (!channelId2Use) {
6623
- this.emit("debug", "NoAudioDebug" /* NoAudioDebug */, {
6624
- state: "error",
6625
- message: `Can't send updatePlayer for voice token session - Missing channelId :: ${safeStringify({ voice: { token: update.token, endpoint: update.endpoint, sessionId: sessionId2Use, channelId: channelId2Use }, update, playerVoice: player.voice }, 2)}`,
6626
- functionLayer: "LavalinkManager > sendRawData()"
6627
- });
6628
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6629
- console.debug(
6630
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Can't send updatePlayer for voice token session - Missing channelId",
6631
- {
6632
- voice: {
6633
- token: update.token,
6634
- endpoint: update.endpoint,
6635
- sessionId: sessionId2Use,
6636
- channelId: channelId2Use
6637
- },
6638
- update,
6639
- playerVoice: player.voice
6640
- }
6641
- );
6615
+ this._debugNoAudio(
6616
+ "error",
6617
+ "LavalinkManager > sendRawData()",
6618
+ {
6619
+ message: `Can't send updatePlayer for voice token session - Missing channelId :: ${safeStringify({ voice: voiceData, update, playerVoice: player.voice }, 2)}`,
6620
+ consoleMessage: "Can't send updatePlayer for voice token session - Missing channelId"
6621
+ },
6622
+ { voice: voiceData, update, playerVoice: player.voice }
6623
+ );
6642
6624
  } else {
6643
6625
  await player.node.updatePlayer({
6644
6626
  guildId: player.guildId,
6645
6627
  playerOptions: {
6646
- voice: {
6647
- token: update.token,
6648
- endpoint: update.endpoint,
6649
- sessionId: sessionId2Use,
6650
- channelId: channelId2Use
6651
- }
6628
+ voice: voiceData
6652
6629
  }
6653
6630
  });
6654
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6655
- state: "log",
6656
- message: `Sent updatePlayer for voice token session :: ${safeStringify({ voice: { token: update.token, endpoint: update.endpoint, sessionId: sessionId2Use, channelId: channelId2Use }, update, playerVoice: player.voice }, 2)}`,
6657
- functionLayer: "LavalinkManager > sendRawData()"
6658
- });
6659
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6660
- console.debug(
6661
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Sent updatePlayer for voice token session",
6662
- {
6663
- voice: {
6664
- token: update.token,
6665
- endpoint: update.endpoint,
6666
- sessionId: sessionId2Use,
6667
- channelId: channelId2Use
6668
- },
6669
- playerVoice: player.voice,
6670
- update
6671
- }
6672
- );
6631
+ this._debugNoAudio(
6632
+ "log",
6633
+ "LavalinkManager > sendRawData()",
6634
+ {
6635
+ message: `Sent updatePlayer for voice token session :: ${safeStringify({ voice: voiceData, update, playerVoice: player.voice }, 2)}`,
6636
+ consoleMessage: "Sent updatePlayer for voice token session"
6637
+ },
6638
+ { voice: voiceData, playerVoice: player.voice, update }
6639
+ );
6673
6640
  }
6674
6641
  return;
6675
6642
  }
@@ -6681,36 +6648,30 @@ var LavalinkManager = class extends import_node_events2.EventEmitter {
6681
6648
  update.user_id
6682
6649
  );
6683
6650
  }
6684
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6685
- state: "warn",
6686
- message: `voice update user is not equal to provided client id of the LavalinkManager.options.client.id :: user: "${update.user_id}" manager client id: "${this.options?.client.id}"`,
6687
- functionLayer: "LavalinkManager > sendRawData()"
6688
- });
6689
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6690
- console.debug(
6691
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, voice update user is not equal to provided client id of the manageroptions#client#id",
6692
- "user:",
6693
- update.user_id,
6694
- "manager client id:",
6695
- this.options?.client.id
6696
- );
6651
+ this._debugNoAudio(
6652
+ "warn",
6653
+ "LavalinkManager > sendRawData()",
6654
+ {
6655
+ message: `voice update user is not equal to provided client id of the LavalinkManager.options.client.id :: user: "${update.user_id}" manager client id: "${this.options?.client.id}"`,
6656
+ consoleMessage: "voice update user is not equal to provided client id of the manageroptions#client#id"
6657
+ },
6658
+ "user:",
6659
+ update.user_id,
6660
+ "manager client id:",
6661
+ this.options?.client.id
6662
+ );
6697
6663
  return;
6698
6664
  }
6699
6665
  if (update.channel_id) {
6700
6666
  if (player.voiceChannelId !== update.channel_id)
6701
6667
  this.emit("playerMove", player, player.voiceChannelId, update.channel_id);
6702
6668
  player.voice.sessionId = update.session_id || player.voice.sessionId;
6703
- player.voice.channelId = update.channel_id;
6669
+ player.voice.channelId = update.channel_id || player.voice.channelId;
6704
6670
  if (!player.voice.sessionId) {
6705
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6706
- state: "warn",
6671
+ this._debugNoAudio("warn", "LavalinkManager > sendRawData()", {
6707
6672
  message: `Function to assing sessionId provided, but no found in Payload: ${safeStringify({ update, playerVoice: player.voice }, 2)}`,
6708
- functionLayer: "LavalinkManager > sendRawData()"
6673
+ consoleMessage: `Function to assing sessionId provided, but no found in Payload: ${safeStringify(update, 2)}`
6709
6674
  });
6710
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6711
- console.debug(
6712
- `Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Function to assing sessionId provided, but no found in Payload: ${safeStringify(update, 2)}`
6713
- );
6714
6675
  }
6715
6676
  player.voiceChannelId = update.channel_id;
6716
6677
  player.options.voiceChannelId = update.channel_id;
package/dist/index.d.cts CHANGED
@@ -952,6 +952,8 @@ interface VoiceServer {
952
952
  guild_id: string;
953
953
  /** Server Endpoint */
954
954
  endpoint: string;
955
+ /** Voice Channel Id (Lavalink v4 DAVE support) */
956
+ channel_id?: string;
955
957
  }
956
958
  interface VoicePacket {
957
959
  /** Voice Packet Keys to send */
@@ -4096,6 +4098,11 @@ declare class LavalinkManager<CustomPlayerT extends Player = Player> extends Eve
4096
4098
  * @param eventData event data
4097
4099
  */
4098
4100
  private _emitDebugEvent;
4101
+ private static readonly _noAudioDebugPrefix;
4102
+ /**
4103
+ * Emits NoAudioDebug and optionally logs to console when debugOptions.noAudio is enabled.
4104
+ */
4105
+ private _debugNoAudio;
4099
4106
  /**
4100
4107
  * Create the Lavalink Manager
4101
4108
  * @param options
package/dist/index.d.ts CHANGED
@@ -952,6 +952,8 @@ interface VoiceServer {
952
952
  guild_id: string;
953
953
  /** Server Endpoint */
954
954
  endpoint: string;
955
+ /** Voice Channel Id (Lavalink v4 DAVE support) */
956
+ channel_id?: string;
955
957
  }
956
958
  interface VoicePacket {
957
959
  /** Voice Packet Keys to send */
@@ -4096,6 +4098,11 @@ declare class LavalinkManager<CustomPlayerT extends Player = Player> extends Eve
4096
4098
  * @param eventData event data
4097
4099
  */
4098
4100
  private _emitDebugEvent;
4101
+ private static readonly _noAudioDebugPrefix;
4102
+ /**
4103
+ * Emits NoAudioDebug and optionally logs to console when debugOptions.noAudio is enabled.
4104
+ */
4105
+ private _debugNoAudio;
4099
4106
  /**
4100
4107
  * Create the Lavalink Manager
4101
4108
  * @param options
package/dist/index.js CHANGED
@@ -6046,7 +6046,7 @@ var Player = class {
6046
6046
  };
6047
6047
 
6048
6048
  // src/structures/LavalinkManager.ts
6049
- var LavalinkManager = class extends EventEmitter2 {
6049
+ var LavalinkManager = class _LavalinkManager extends EventEmitter2 {
6050
6050
  /**
6051
6051
  * Emit an event
6052
6052
  * @param event The event to emit
@@ -6215,6 +6215,17 @@ var LavalinkManager = class extends EventEmitter2 {
6215
6215
  if (!this.options?.advancedOptions?.enableDebugEvents) return;
6216
6216
  this.emit("debug", name, eventData);
6217
6217
  }
6218
+ static _noAudioDebugPrefix = "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, ";
6219
+ /**
6220
+ * Emits NoAudioDebug and optionally logs to console when debugOptions.noAudio is enabled.
6221
+ */
6222
+ _debugNoAudio(state, functionLayer, messages, ...consoleArgs) {
6223
+ this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, { state, functionLayer, message: messages.message });
6224
+ if (this.options?.advancedOptions?.debugOptions?.noAudio === true) {
6225
+ const consoleMsg = messages.consoleMessage ?? messages.message;
6226
+ console.debug(_LavalinkManager._noAudioDebugPrefix + consoleMsg, ...consoleArgs);
6227
+ }
6228
+ }
6218
6229
  /**
6219
6230
  * Create the Lavalink Manager
6220
6231
  * @param options
@@ -6446,28 +6457,22 @@ var LavalinkManager = class extends EventEmitter2 {
6446
6457
  */
6447
6458
  async sendRawData(data) {
6448
6459
  if (!this.initiated) {
6449
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6450
- state: "log",
6460
+ this._debugNoAudio("log", "LavalinkManager > sendRawData()", {
6451
6461
  message: "Manager is not initated yet",
6452
- functionLayer: "LavalinkManager > sendRawData()"
6462
+ consoleMessage: "manager is not initated yet"
6453
6463
  });
6454
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6455
- console.debug(
6456
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, manager is not initated yet"
6457
- );
6458
6464
  return;
6459
6465
  }
6460
6466
  if (!("t" in data)) {
6461
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6462
- state: "error",
6463
- message: "No 't' in payload-data of the raw event:",
6464
- functionLayer: "LavalinkManager > sendRawData()"
6465
- });
6466
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6467
- console.debug(
6468
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, no 't' in payload-data of the raw event:",
6469
- data
6470
- );
6467
+ this._debugNoAudio(
6468
+ "error",
6469
+ "LavalinkManager > sendRawData()",
6470
+ {
6471
+ message: "No 't' in payload-data of the raw event:",
6472
+ consoleMessage: "no 't' in payload-data of the raw event:"
6473
+ },
6474
+ data
6475
+ );
6471
6476
  return;
6472
6477
  }
6473
6478
  if ("CHANNEL_DELETE" === data.t) {
@@ -6480,132 +6485,94 @@ var LavalinkManager = class extends EventEmitter2 {
6480
6485
  if (["VOICE_STATE_UPDATE", "VOICE_SERVER_UPDATE"].includes(data.t)) {
6481
6486
  const update = "d" in data ? data.d : data;
6482
6487
  if (!update) {
6483
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6484
- state: "warn",
6485
- message: `No Update data found in payload :: ${safeStringify(data, 2)}`,
6486
- functionLayer: "LavalinkManager > sendRawData()"
6487
- });
6488
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6489
- console.debug(
6490
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, no update data found in payload:",
6491
- data
6492
- );
6488
+ this._debugNoAudio(
6489
+ "warn",
6490
+ "LavalinkManager > sendRawData()",
6491
+ {
6492
+ message: `No Update data found in payload :: ${safeStringify(data, 2)}`,
6493
+ consoleMessage: "no update data found in payload:"
6494
+ },
6495
+ data
6496
+ );
6493
6497
  return;
6494
6498
  }
6495
6499
  if (!("token" in update) && !("session_id" in update)) {
6496
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6497
- state: "error",
6498
- message: `No 'token' nor 'session_id' found in payload :: ${safeStringify(data, 2)}`,
6499
- functionLayer: "LavalinkManager > sendRawData()"
6500
- });
6501
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6502
- console.debug(
6503
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, no 'token' nor 'session_id' found in payload:",
6504
- data
6505
- );
6500
+ this._debugNoAudio(
6501
+ "error",
6502
+ "LavalinkManager > sendRawData()",
6503
+ {
6504
+ message: `No 'token' nor 'session_id' found in payload :: ${safeStringify(data, 2)}`,
6505
+ consoleMessage: "no 'token' nor 'session_id' found in payload:"
6506
+ },
6507
+ data
6508
+ );
6506
6509
  return;
6507
6510
  }
6508
6511
  const player = this.getPlayer(update.guild_id);
6509
6512
  if (!player) {
6510
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6511
- state: "warn",
6512
- message: `No Lavalink Player found via key: 'guild_id' of update-data :: ${safeStringify(update, 2)}`,
6513
- functionLayer: "LavalinkManager > sendRawData()"
6514
- });
6515
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6516
- console.debug(
6517
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, No Lavalink Player found via key: 'guild_id' of update-data:",
6518
- update
6519
- );
6513
+ this._debugNoAudio(
6514
+ "warn",
6515
+ "LavalinkManager > sendRawData()",
6516
+ {
6517
+ message: `No Lavalink Player found via key: 'guild_id' of update-data :: ${safeStringify(update, 2)}`,
6518
+ consoleMessage: "No Lavalink Player found via key: 'guild_id' of update-data:"
6519
+ },
6520
+ update
6521
+ );
6520
6522
  return;
6521
6523
  }
6522
6524
  if (player.get("internal_destroystatus") === true) {
6523
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6524
- state: "warn",
6525
- message: `Player is in a destroying state. can't signal the voice states`,
6526
- functionLayer: "LavalinkManager > sendRawData()"
6525
+ this._debugNoAudio("warn", "LavalinkManager > sendRawData()", {
6526
+ message: "Player is in a destroying state. can't signal the voice states"
6527
6527
  });
6528
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6529
- console.debug(
6530
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Player is in a destroying state. can't signal the voice states"
6531
- );
6532
6528
  return;
6533
6529
  }
6534
6530
  if ("token" in update) {
6535
6531
  if (!player.node?.sessionId) throw new Error("Lavalink Node is either not ready or not up to date");
6536
6532
  const sessionId2Use = player.voice?.sessionId || ("sessionId" in update ? update.sessionId : void 0);
6537
6533
  const channelId2Use = player.voice?.channelId || ("channel_id" in update ? update.channel_id : void 0);
6534
+ const voiceData = {
6535
+ token: update.token,
6536
+ endpoint: update.endpoint,
6537
+ sessionId: sessionId2Use,
6538
+ channelId: channelId2Use
6539
+ };
6538
6540
  if (!sessionId2Use) {
6539
- this.emit("debug", "NoAudioDebug" /* NoAudioDebug */, {
6540
- state: "error",
6541
- message: `Can't send updatePlayer for voice token session - Missing sessionId :: ${safeStringify({ voice: { token: update.token, endpoint: update.endpoint, sessionId: sessionId2Use, channelId: channelId2Use }, update, playerVoice: player.voice }, 2)}`,
6542
- functionLayer: "LavalinkManager > sendRawData()"
6543
- });
6544
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6545
- console.debug(
6546
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Can't send updatePlayer for voice token session - Missing sessionId",
6547
- {
6548
- voice: {
6549
- token: update.token,
6550
- endpoint: update.endpoint,
6551
- sessionId: sessionId2Use,
6552
- channelId: channelId2Use
6553
- },
6554
- update,
6555
- playerVoice: player.voice
6556
- }
6557
- );
6541
+ this._debugNoAudio(
6542
+ "error",
6543
+ "LavalinkManager > sendRawData()",
6544
+ {
6545
+ message: `Can't send updatePlayer for voice token session - Missing sessionId :: ${safeStringify({ voice: voiceData, update, playerVoice: player.voice }, 2)}`,
6546
+ consoleMessage: "Can't send updatePlayer for voice token session - Missing sessionId"
6547
+ },
6548
+ { voice: voiceData, update, playerVoice: player.voice }
6549
+ );
6558
6550
  } else if (!channelId2Use) {
6559
- this.emit("debug", "NoAudioDebug" /* NoAudioDebug */, {
6560
- state: "error",
6561
- message: `Can't send updatePlayer for voice token session - Missing channelId :: ${safeStringify({ voice: { token: update.token, endpoint: update.endpoint, sessionId: sessionId2Use, channelId: channelId2Use }, update, playerVoice: player.voice }, 2)}`,
6562
- functionLayer: "LavalinkManager > sendRawData()"
6563
- });
6564
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6565
- console.debug(
6566
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Can't send updatePlayer for voice token session - Missing channelId",
6567
- {
6568
- voice: {
6569
- token: update.token,
6570
- endpoint: update.endpoint,
6571
- sessionId: sessionId2Use,
6572
- channelId: channelId2Use
6573
- },
6574
- update,
6575
- playerVoice: player.voice
6576
- }
6577
- );
6551
+ this._debugNoAudio(
6552
+ "error",
6553
+ "LavalinkManager > sendRawData()",
6554
+ {
6555
+ message: `Can't send updatePlayer for voice token session - Missing channelId :: ${safeStringify({ voice: voiceData, update, playerVoice: player.voice }, 2)}`,
6556
+ consoleMessage: "Can't send updatePlayer for voice token session - Missing channelId"
6557
+ },
6558
+ { voice: voiceData, update, playerVoice: player.voice }
6559
+ );
6578
6560
  } else {
6579
6561
  await player.node.updatePlayer({
6580
6562
  guildId: player.guildId,
6581
6563
  playerOptions: {
6582
- voice: {
6583
- token: update.token,
6584
- endpoint: update.endpoint,
6585
- sessionId: sessionId2Use,
6586
- channelId: channelId2Use
6587
- }
6564
+ voice: voiceData
6588
6565
  }
6589
6566
  });
6590
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6591
- state: "log",
6592
- message: `Sent updatePlayer for voice token session :: ${safeStringify({ voice: { token: update.token, endpoint: update.endpoint, sessionId: sessionId2Use, channelId: channelId2Use }, update, playerVoice: player.voice }, 2)}`,
6593
- functionLayer: "LavalinkManager > sendRawData()"
6594
- });
6595
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6596
- console.debug(
6597
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Sent updatePlayer for voice token session",
6598
- {
6599
- voice: {
6600
- token: update.token,
6601
- endpoint: update.endpoint,
6602
- sessionId: sessionId2Use,
6603
- channelId: channelId2Use
6604
- },
6605
- playerVoice: player.voice,
6606
- update
6607
- }
6608
- );
6567
+ this._debugNoAudio(
6568
+ "log",
6569
+ "LavalinkManager > sendRawData()",
6570
+ {
6571
+ message: `Sent updatePlayer for voice token session :: ${safeStringify({ voice: voiceData, update, playerVoice: player.voice }, 2)}`,
6572
+ consoleMessage: "Sent updatePlayer for voice token session"
6573
+ },
6574
+ { voice: voiceData, playerVoice: player.voice, update }
6575
+ );
6609
6576
  }
6610
6577
  return;
6611
6578
  }
@@ -6617,36 +6584,30 @@ var LavalinkManager = class extends EventEmitter2 {
6617
6584
  update.user_id
6618
6585
  );
6619
6586
  }
6620
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6621
- state: "warn",
6622
- message: `voice update user is not equal to provided client id of the LavalinkManager.options.client.id :: user: "${update.user_id}" manager client id: "${this.options?.client.id}"`,
6623
- functionLayer: "LavalinkManager > sendRawData()"
6624
- });
6625
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6626
- console.debug(
6627
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, voice update user is not equal to provided client id of the manageroptions#client#id",
6628
- "user:",
6629
- update.user_id,
6630
- "manager client id:",
6631
- this.options?.client.id
6632
- );
6587
+ this._debugNoAudio(
6588
+ "warn",
6589
+ "LavalinkManager > sendRawData()",
6590
+ {
6591
+ message: `voice update user is not equal to provided client id of the LavalinkManager.options.client.id :: user: "${update.user_id}" manager client id: "${this.options?.client.id}"`,
6592
+ consoleMessage: "voice update user is not equal to provided client id of the manageroptions#client#id"
6593
+ },
6594
+ "user:",
6595
+ update.user_id,
6596
+ "manager client id:",
6597
+ this.options?.client.id
6598
+ );
6633
6599
  return;
6634
6600
  }
6635
6601
  if (update.channel_id) {
6636
6602
  if (player.voiceChannelId !== update.channel_id)
6637
6603
  this.emit("playerMove", player, player.voiceChannelId, update.channel_id);
6638
6604
  player.voice.sessionId = update.session_id || player.voice.sessionId;
6639
- player.voice.channelId = update.channel_id;
6605
+ player.voice.channelId = update.channel_id || player.voice.channelId;
6640
6606
  if (!player.voice.sessionId) {
6641
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6642
- state: "warn",
6607
+ this._debugNoAudio("warn", "LavalinkManager > sendRawData()", {
6643
6608
  message: `Function to assing sessionId provided, but no found in Payload: ${safeStringify({ update, playerVoice: player.voice }, 2)}`,
6644
- functionLayer: "LavalinkManager > sendRawData()"
6609
+ consoleMessage: `Function to assing sessionId provided, but no found in Payload: ${safeStringify(update, 2)}`
6645
6610
  });
6646
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6647
- console.debug(
6648
- `Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Function to assing sessionId provided, but no found in Payload: ${safeStringify(update, 2)}`
6649
- );
6650
6611
  }
6651
6612
  player.voiceChannelId = update.channel_id;
6652
6613
  player.options.voiceChannelId = update.channel_id;
package/dist/index.mjs CHANGED
@@ -6046,7 +6046,7 @@ var Player = class {
6046
6046
  };
6047
6047
 
6048
6048
  // src/structures/LavalinkManager.ts
6049
- var LavalinkManager = class extends EventEmitter2 {
6049
+ var LavalinkManager = class _LavalinkManager extends EventEmitter2 {
6050
6050
  /**
6051
6051
  * Emit an event
6052
6052
  * @param event The event to emit
@@ -6215,6 +6215,17 @@ var LavalinkManager = class extends EventEmitter2 {
6215
6215
  if (!this.options?.advancedOptions?.enableDebugEvents) return;
6216
6216
  this.emit("debug", name, eventData);
6217
6217
  }
6218
+ static _noAudioDebugPrefix = "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, ";
6219
+ /**
6220
+ * Emits NoAudioDebug and optionally logs to console when debugOptions.noAudio is enabled.
6221
+ */
6222
+ _debugNoAudio(state, functionLayer, messages, ...consoleArgs) {
6223
+ this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, { state, functionLayer, message: messages.message });
6224
+ if (this.options?.advancedOptions?.debugOptions?.noAudio === true) {
6225
+ const consoleMsg = messages.consoleMessage ?? messages.message;
6226
+ console.debug(_LavalinkManager._noAudioDebugPrefix + consoleMsg, ...consoleArgs);
6227
+ }
6228
+ }
6218
6229
  /**
6219
6230
  * Create the Lavalink Manager
6220
6231
  * @param options
@@ -6446,28 +6457,22 @@ var LavalinkManager = class extends EventEmitter2 {
6446
6457
  */
6447
6458
  async sendRawData(data) {
6448
6459
  if (!this.initiated) {
6449
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6450
- state: "log",
6460
+ this._debugNoAudio("log", "LavalinkManager > sendRawData()", {
6451
6461
  message: "Manager is not initated yet",
6452
- functionLayer: "LavalinkManager > sendRawData()"
6462
+ consoleMessage: "manager is not initated yet"
6453
6463
  });
6454
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6455
- console.debug(
6456
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, manager is not initated yet"
6457
- );
6458
6464
  return;
6459
6465
  }
6460
6466
  if (!("t" in data)) {
6461
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6462
- state: "error",
6463
- message: "No 't' in payload-data of the raw event:",
6464
- functionLayer: "LavalinkManager > sendRawData()"
6465
- });
6466
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6467
- console.debug(
6468
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, no 't' in payload-data of the raw event:",
6469
- data
6470
- );
6467
+ this._debugNoAudio(
6468
+ "error",
6469
+ "LavalinkManager > sendRawData()",
6470
+ {
6471
+ message: "No 't' in payload-data of the raw event:",
6472
+ consoleMessage: "no 't' in payload-data of the raw event:"
6473
+ },
6474
+ data
6475
+ );
6471
6476
  return;
6472
6477
  }
6473
6478
  if ("CHANNEL_DELETE" === data.t) {
@@ -6480,132 +6485,94 @@ var LavalinkManager = class extends EventEmitter2 {
6480
6485
  if (["VOICE_STATE_UPDATE", "VOICE_SERVER_UPDATE"].includes(data.t)) {
6481
6486
  const update = "d" in data ? data.d : data;
6482
6487
  if (!update) {
6483
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6484
- state: "warn",
6485
- message: `No Update data found in payload :: ${safeStringify(data, 2)}`,
6486
- functionLayer: "LavalinkManager > sendRawData()"
6487
- });
6488
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6489
- console.debug(
6490
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, no update data found in payload:",
6491
- data
6492
- );
6488
+ this._debugNoAudio(
6489
+ "warn",
6490
+ "LavalinkManager > sendRawData()",
6491
+ {
6492
+ message: `No Update data found in payload :: ${safeStringify(data, 2)}`,
6493
+ consoleMessage: "no update data found in payload:"
6494
+ },
6495
+ data
6496
+ );
6493
6497
  return;
6494
6498
  }
6495
6499
  if (!("token" in update) && !("session_id" in update)) {
6496
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6497
- state: "error",
6498
- message: `No 'token' nor 'session_id' found in payload :: ${safeStringify(data, 2)}`,
6499
- functionLayer: "LavalinkManager > sendRawData()"
6500
- });
6501
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6502
- console.debug(
6503
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, no 'token' nor 'session_id' found in payload:",
6504
- data
6505
- );
6500
+ this._debugNoAudio(
6501
+ "error",
6502
+ "LavalinkManager > sendRawData()",
6503
+ {
6504
+ message: `No 'token' nor 'session_id' found in payload :: ${safeStringify(data, 2)}`,
6505
+ consoleMessage: "no 'token' nor 'session_id' found in payload:"
6506
+ },
6507
+ data
6508
+ );
6506
6509
  return;
6507
6510
  }
6508
6511
  const player = this.getPlayer(update.guild_id);
6509
6512
  if (!player) {
6510
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6511
- state: "warn",
6512
- message: `No Lavalink Player found via key: 'guild_id' of update-data :: ${safeStringify(update, 2)}`,
6513
- functionLayer: "LavalinkManager > sendRawData()"
6514
- });
6515
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6516
- console.debug(
6517
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, No Lavalink Player found via key: 'guild_id' of update-data:",
6518
- update
6519
- );
6513
+ this._debugNoAudio(
6514
+ "warn",
6515
+ "LavalinkManager > sendRawData()",
6516
+ {
6517
+ message: `No Lavalink Player found via key: 'guild_id' of update-data :: ${safeStringify(update, 2)}`,
6518
+ consoleMessage: "No Lavalink Player found via key: 'guild_id' of update-data:"
6519
+ },
6520
+ update
6521
+ );
6520
6522
  return;
6521
6523
  }
6522
6524
  if (player.get("internal_destroystatus") === true) {
6523
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6524
- state: "warn",
6525
- message: `Player is in a destroying state. can't signal the voice states`,
6526
- functionLayer: "LavalinkManager > sendRawData()"
6525
+ this._debugNoAudio("warn", "LavalinkManager > sendRawData()", {
6526
+ message: "Player is in a destroying state. can't signal the voice states"
6527
6527
  });
6528
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6529
- console.debug(
6530
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Player is in a destroying state. can't signal the voice states"
6531
- );
6532
6528
  return;
6533
6529
  }
6534
6530
  if ("token" in update) {
6535
6531
  if (!player.node?.sessionId) throw new Error("Lavalink Node is either not ready or not up to date");
6536
6532
  const sessionId2Use = player.voice?.sessionId || ("sessionId" in update ? update.sessionId : void 0);
6537
6533
  const channelId2Use = player.voice?.channelId || ("channel_id" in update ? update.channel_id : void 0);
6534
+ const voiceData = {
6535
+ token: update.token,
6536
+ endpoint: update.endpoint,
6537
+ sessionId: sessionId2Use,
6538
+ channelId: channelId2Use
6539
+ };
6538
6540
  if (!sessionId2Use) {
6539
- this.emit("debug", "NoAudioDebug" /* NoAudioDebug */, {
6540
- state: "error",
6541
- message: `Can't send updatePlayer for voice token session - Missing sessionId :: ${safeStringify({ voice: { token: update.token, endpoint: update.endpoint, sessionId: sessionId2Use, channelId: channelId2Use }, update, playerVoice: player.voice }, 2)}`,
6542
- functionLayer: "LavalinkManager > sendRawData()"
6543
- });
6544
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6545
- console.debug(
6546
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Can't send updatePlayer for voice token session - Missing sessionId",
6547
- {
6548
- voice: {
6549
- token: update.token,
6550
- endpoint: update.endpoint,
6551
- sessionId: sessionId2Use,
6552
- channelId: channelId2Use
6553
- },
6554
- update,
6555
- playerVoice: player.voice
6556
- }
6557
- );
6541
+ this._debugNoAudio(
6542
+ "error",
6543
+ "LavalinkManager > sendRawData()",
6544
+ {
6545
+ message: `Can't send updatePlayer for voice token session - Missing sessionId :: ${safeStringify({ voice: voiceData, update, playerVoice: player.voice }, 2)}`,
6546
+ consoleMessage: "Can't send updatePlayer for voice token session - Missing sessionId"
6547
+ },
6548
+ { voice: voiceData, update, playerVoice: player.voice }
6549
+ );
6558
6550
  } else if (!channelId2Use) {
6559
- this.emit("debug", "NoAudioDebug" /* NoAudioDebug */, {
6560
- state: "error",
6561
- message: `Can't send updatePlayer for voice token session - Missing channelId :: ${safeStringify({ voice: { token: update.token, endpoint: update.endpoint, sessionId: sessionId2Use, channelId: channelId2Use }, update, playerVoice: player.voice }, 2)}`,
6562
- functionLayer: "LavalinkManager > sendRawData()"
6563
- });
6564
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6565
- console.debug(
6566
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Can't send updatePlayer for voice token session - Missing channelId",
6567
- {
6568
- voice: {
6569
- token: update.token,
6570
- endpoint: update.endpoint,
6571
- sessionId: sessionId2Use,
6572
- channelId: channelId2Use
6573
- },
6574
- update,
6575
- playerVoice: player.voice
6576
- }
6577
- );
6551
+ this._debugNoAudio(
6552
+ "error",
6553
+ "LavalinkManager > sendRawData()",
6554
+ {
6555
+ message: `Can't send updatePlayer for voice token session - Missing channelId :: ${safeStringify({ voice: voiceData, update, playerVoice: player.voice }, 2)}`,
6556
+ consoleMessage: "Can't send updatePlayer for voice token session - Missing channelId"
6557
+ },
6558
+ { voice: voiceData, update, playerVoice: player.voice }
6559
+ );
6578
6560
  } else {
6579
6561
  await player.node.updatePlayer({
6580
6562
  guildId: player.guildId,
6581
6563
  playerOptions: {
6582
- voice: {
6583
- token: update.token,
6584
- endpoint: update.endpoint,
6585
- sessionId: sessionId2Use,
6586
- channelId: channelId2Use
6587
- }
6564
+ voice: voiceData
6588
6565
  }
6589
6566
  });
6590
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6591
- state: "log",
6592
- message: `Sent updatePlayer for voice token session :: ${safeStringify({ voice: { token: update.token, endpoint: update.endpoint, sessionId: sessionId2Use, channelId: channelId2Use }, update, playerVoice: player.voice }, 2)}`,
6593
- functionLayer: "LavalinkManager > sendRawData()"
6594
- });
6595
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6596
- console.debug(
6597
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Sent updatePlayer for voice token session",
6598
- {
6599
- voice: {
6600
- token: update.token,
6601
- endpoint: update.endpoint,
6602
- sessionId: sessionId2Use,
6603
- channelId: channelId2Use
6604
- },
6605
- playerVoice: player.voice,
6606
- update
6607
- }
6608
- );
6567
+ this._debugNoAudio(
6568
+ "log",
6569
+ "LavalinkManager > sendRawData()",
6570
+ {
6571
+ message: `Sent updatePlayer for voice token session :: ${safeStringify({ voice: voiceData, update, playerVoice: player.voice }, 2)}`,
6572
+ consoleMessage: "Sent updatePlayer for voice token session"
6573
+ },
6574
+ { voice: voiceData, playerVoice: player.voice, update }
6575
+ );
6609
6576
  }
6610
6577
  return;
6611
6578
  }
@@ -6617,36 +6584,30 @@ var LavalinkManager = class extends EventEmitter2 {
6617
6584
  update.user_id
6618
6585
  );
6619
6586
  }
6620
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6621
- state: "warn",
6622
- message: `voice update user is not equal to provided client id of the LavalinkManager.options.client.id :: user: "${update.user_id}" manager client id: "${this.options?.client.id}"`,
6623
- functionLayer: "LavalinkManager > sendRawData()"
6624
- });
6625
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6626
- console.debug(
6627
- "Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, voice update user is not equal to provided client id of the manageroptions#client#id",
6628
- "user:",
6629
- update.user_id,
6630
- "manager client id:",
6631
- this.options?.client.id
6632
- );
6587
+ this._debugNoAudio(
6588
+ "warn",
6589
+ "LavalinkManager > sendRawData()",
6590
+ {
6591
+ message: `voice update user is not equal to provided client id of the LavalinkManager.options.client.id :: user: "${update.user_id}" manager client id: "${this.options?.client.id}"`,
6592
+ consoleMessage: "voice update user is not equal to provided client id of the manageroptions#client#id"
6593
+ },
6594
+ "user:",
6595
+ update.user_id,
6596
+ "manager client id:",
6597
+ this.options?.client.id
6598
+ );
6633
6599
  return;
6634
6600
  }
6635
6601
  if (update.channel_id) {
6636
6602
  if (player.voiceChannelId !== update.channel_id)
6637
6603
  this.emit("playerMove", player, player.voiceChannelId, update.channel_id);
6638
6604
  player.voice.sessionId = update.session_id || player.voice.sessionId;
6639
- player.voice.channelId = update.channel_id;
6605
+ player.voice.channelId = update.channel_id || player.voice.channelId;
6640
6606
  if (!player.voice.sessionId) {
6641
- this._emitDebugEvent("NoAudioDebug" /* NoAudioDebug */, {
6642
- state: "warn",
6607
+ this._debugNoAudio("warn", "LavalinkManager > sendRawData()", {
6643
6608
  message: `Function to assing sessionId provided, but no found in Payload: ${safeStringify({ update, playerVoice: player.voice }, 2)}`,
6644
- functionLayer: "LavalinkManager > sendRawData()"
6609
+ consoleMessage: `Function to assing sessionId provided, but no found in Payload: ${safeStringify(update, 2)}`
6645
6610
  });
6646
- if (this.options?.advancedOptions?.debugOptions?.noAudio === true)
6647
- console.debug(
6648
- `Lavalink-Client-Debug | NO-AUDIO [::] sendRawData function, Function to assing sessionId provided, but no found in Payload: ${safeStringify(update, 2)}`
6649
- );
6650
6611
  }
6651
6612
  player.voiceChannelId = update.channel_id;
6652
6613
  player.options.voiceChannelId = update.channel_id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lavalink-client",
3
- "version": "2.9.5",
3
+ "version": "2.9.6",
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",
@@ -39,8 +39,10 @@
39
39
  "exports": {
40
40
  ".": {
41
41
  "types": "./dist/index.d.ts",
42
+ "bun": "./dist/index.mjs",
42
43
  "require": "./dist/index.cjs",
43
- "import": "./dist/index.mjs"
44
+ "import": "./dist/index.mjs",
45
+ "default": "./dist/index.mjs"
44
46
  }
45
47
  },
46
48
  "publishConfig": {