voice: fix receiver null on immediate voiceStateUpdate

This commit is contained in:
Amish Shah
2018-11-15 21:38:02 +00:00
parent 3418b5a1a2
commit 2d68e837e5
3 changed files with 3 additions and 3 deletions

View File

@@ -113,7 +113,7 @@ class VoiceConnection extends EventEmitter {
* The voice receiver of this connection
* @type {VoiceReceiver}
*/
this.receiver = null;
this.receiver = new VoiceReceiver(this);
this.authenticate();
}
@@ -418,7 +418,6 @@ class VoiceConnection extends EventEmitter {
Object.assign(this.authentication, data);
this.status = VoiceStatus.CONNECTED;
clearTimeout(this.connectTimeout);
this.receiver = new VoiceReceiver(this);
/**
* Emitted once the connection is ready, when a promise to join a voice channel resolves,
* the connection will already be ready.