mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Add client.destroy();
This commit is contained in:
@@ -66,7 +66,7 @@ class VoiceConnectionWebSocket extends EventEmitter {
|
||||
}
|
||||
|
||||
_setHeartbeat(interval) {
|
||||
this.heartbeat = setInterval(() => {
|
||||
this.heartbeat = this.voiceConnection.manager.client.setInterval(() => {
|
||||
this.send({
|
||||
op: Constants.VoiceOPCodes.HEARTBEAT,
|
||||
d: null,
|
||||
|
||||
@@ -70,7 +70,7 @@ class StreamDispatcher extends EventEmitter {
|
||||
}
|
||||
if (this.paused) {
|
||||
data.timestamp = (data.timestamp + 4294967295) ? data.timestamp + 960 : 0;
|
||||
return setTimeout(() => this._send(), data.length * 10);
|
||||
return this.player.connection.manager.client.setTimeout(() => this._send(), data.length * 10);
|
||||
}
|
||||
const bufferLength = 1920 * data.channels;
|
||||
this._setSpeaking(true);
|
||||
@@ -78,7 +78,7 @@ class StreamDispatcher extends EventEmitter {
|
||||
|
||||
if (!buffer) {
|
||||
data.missed++;
|
||||
return setTimeout(() => this._send(), data.length * 10);
|
||||
return this.player.connection.manager.client.setTimeout(() => this._send(), data.length * 10);
|
||||
}
|
||||
|
||||
data.missed = 0;
|
||||
@@ -97,7 +97,7 @@ class StreamDispatcher extends EventEmitter {
|
||||
|
||||
const nextTime = data.startTime + (data.count * data.length);
|
||||
|
||||
setTimeout(() => this._send(), data.length + (nextTime - Date.now()));
|
||||
this.player.connection.manager.client.setTimeout(() => this._send(), data.length + (nextTime - Date.now()));
|
||||
} catch (e) {
|
||||
this._triggerTerminalState('error', e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user