Fixes unused creation of REST clients for DiscordShardedClient shards. (#2109)

* Init

* Remove unnecessary length check

* Swap out for any check

* Final; Check if parentclient was passed
This commit is contained in:
Armano den Boef
2022-02-16 12:51:15 +01:00
committed by GitHub
parent fad217e8bc
commit 6039378c52

View File

@@ -152,6 +152,7 @@ namespace Discord.WebSocket
LogGatewayIntentWarnings = config.LogGatewayIntentWarnings;
HandlerTimeout = config.HandlerTimeout;
State = new ClientState(0, 0);
if (shardedClient is null || parentClient is null)
Rest = new DiscordSocketRestClient(config, ApiClient);
_heartbeatTimes = new ConcurrentQueue<long>();
_gatewayIntents = config.GatewayIntents;