mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 09:42:22 +00:00
voice: fix heartbeat issue (#2443)
This commit is contained in:
parent
e431ccdad2
commit
41d0f25d0f
2 changed files with 2 additions and 1 deletions
|
|
@ -133,6 +133,7 @@ class VoiceConnection extends EventEmitter {
|
||||||
d: {
|
d: {
|
||||||
speaking: this.speaking,
|
speaking: this.speaking,
|
||||||
delay: 0,
|
delay: 0,
|
||||||
|
ssrc: this.authentication.ssrc,
|
||||||
},
|
},
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
this.emit('debug', e);
|
this.emit('debug', e);
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,7 @@ class VoiceWebSocket extends EventEmitter {
|
||||||
* Sends a heartbeat packet.
|
* Sends a heartbeat packet.
|
||||||
*/
|
*/
|
||||||
sendHeartbeat() {
|
sendHeartbeat() {
|
||||||
this.sendPacket({ op: VoiceOPCodes.HEARTBEAT, d: null }).catch(() => {
|
this.sendPacket({ op: VoiceOPCodes.HEARTBEAT, d: Math.floor(Math.random() * 10e10) }).catch(() => {
|
||||||
this.emit('warn', 'Tried to send heartbeat, but connection is not open');
|
this.emit('warn', 'Tried to send heartbeat, but connection is not open');
|
||||||
this.clearHeartbeat();
|
this.clearHeartbeat();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue