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 +101 -140
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +101 -140
- package/dist/index.mjs +101 -140
- package/package.json +4 -2
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.
|
|
6514
|
-
state: "log",
|
|
6524
|
+
this._debugNoAudio("log", "LavalinkManager > sendRawData()", {
|
|
6515
6525
|
message: "Manager is not initated yet",
|
|
6516
|
-
|
|
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.
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
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.
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
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.
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
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.
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
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.
|
|
6588
|
-
|
|
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.
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
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.
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
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.
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
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.
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
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.
|
|
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
|
-
|
|
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.
|
|
6450
|
-
state: "log",
|
|
6460
|
+
this._debugNoAudio("log", "LavalinkManager > sendRawData()", {
|
|
6451
6461
|
message: "Manager is not initated yet",
|
|
6452
|
-
|
|
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.
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
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.
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
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.
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
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.
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
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.
|
|
6524
|
-
|
|
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.
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
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.
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
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.
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
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.
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
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.
|
|
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
|
-
|
|
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.
|
|
6450
|
-
state: "log",
|
|
6460
|
+
this._debugNoAudio("log", "LavalinkManager > sendRawData()", {
|
|
6451
6461
|
message: "Manager is not initated yet",
|
|
6452
|
-
|
|
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.
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
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.
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
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.
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
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.
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
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.
|
|
6524
|
-
|
|
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.
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
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.
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
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.
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
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.
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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": {
|