From 162bc818f490b56f187701e586ecd29b04c08695 Mon Sep 17 00:00:00 2001 From: Quahu Date: Sat, 3 Sep 2022 21:00:42 +0200 Subject: [PATCH] Made the requested changes. --- src/Discord.Net.WebSocket/DiscordSocketApiClient.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Discord.Net.WebSocket/DiscordSocketApiClient.cs b/src/Discord.Net.WebSocket/DiscordSocketApiClient.cs index cf4a43967..15d197a55 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketApiClient.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketApiClient.cs @@ -216,8 +216,8 @@ namespace Discord.API { if (!_isExplicitUrl) { - // TODO: 'GetGatewayAsync' -> 'GetBotGatewayAsync', but it could just be hardcoded to 'wss://gateway.discord.gg/' - var gatewayResponse = await GetGatewayAsync().ConfigureAwait(false); + // TODO: pass this down from DiscordShardedClient, so that it's not requested separately for every single shard + var gatewayResponse = await GetBotGatewayAsync().ConfigureAwait(false); gatewayUrl = _gatewayUrl = FormatGatewayUrl(gatewayResponse.Url); } else @@ -240,12 +240,6 @@ namespace Discord.API } catch { - if (!_isExplicitUrl) - { - // TODO: '_gatewayUrl = null' doesn't do anything, it's never null checked - _gatewayUrl = null; //Uncache in case the gateway url changed - } - await DisconnectInternalAsync().ConfigureAwait(false); throw; }