From db703b51b0f25cb174a17fdedc6a72ff859d3296 Mon Sep 17 00:00:00 2001 From: RogueException Date: Mon, 19 Oct 2015 02:08:14 -0300 Subject: [PATCH] Use VoiceKeepAlives --- src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs b/src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs index 78ee27271..aea264c6c 100644 --- a/src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs +++ b/src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs @@ -90,7 +90,9 @@ namespace Discord.Net.WebSockets { try { - await Start().ConfigureAwait(false); + //This check is needed in case we start a reconnect before the initial login completes + if (_state != (int)WebSocketState.Disconnected) + await Start().ConfigureAwait(false); break; } catch (OperationCanceledException) { throw; } @@ -533,7 +535,7 @@ namespace Discord.Net.WebSockets protected override object GetKeepAlive() { - return new KeepAliveCommand(); + return new VoiceKeepAliveCommand(); } public void WaitForQueue()