mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01:00
fix: stream dispatcher throwing key error due to missing secretKey
This commit is contained in:
@@ -155,7 +155,8 @@ class VoiceWebSocket extends EventEmitter {
|
|||||||
onPacket(packet) {
|
onPacket(packet) {
|
||||||
switch (packet.op) {
|
switch (packet.op) {
|
||||||
case VoiceOPCodes.READY:
|
case VoiceOPCodes.READY:
|
||||||
this.setHeartbeat(packet.d.heartbeat_interval);
|
// *.75 to correct for discord devs taking longer to fix things than i do to release versions
|
||||||
|
this.setHeartbeat(packet.d.heartbeat_interval * 0.75);
|
||||||
/**
|
/**
|
||||||
* Emitted once the voice WebSocket receives the ready packet.
|
* Emitted once the voice WebSocket receives the ready packet.
|
||||||
* @param {Object} packet The received packet
|
* @param {Object} packet The received packet
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ class StreamDispatcher extends Writable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_playChunk(chunk) {
|
_playChunk(chunk) {
|
||||||
if (this.player.dispatcher !== this) return;
|
if (this.player.dispatcher !== this || !this.player.voiceConnection.authentication.secretKey) return;
|
||||||
this._setSpeaking(true);
|
this._setSpeaking(true);
|
||||||
this._sendPacket(this._createPacket(this._sdata.sequence, this._sdata.timestamp, chunk));
|
this._sendPacket(this._createPacket(this._sdata.sequence, this._sdata.timestamp, chunk));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user