Browse Source

Made the requested changes.

pull/2423/head
Quahu 2 years ago
parent
commit
162bc818f4
1 changed files with 2 additions and 8 deletions
  1. +2
    -8
      src/Discord.Net.WebSocket/DiscordSocketApiClient.cs

+ 2
- 8
src/Discord.Net.WebSocket/DiscordSocketApiClient.cs View File

@@ -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;
}


Loading…
Cancel
Save