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,7 +152,8 @@ namespace Discord.WebSocket
LogGatewayIntentWarnings = config.LogGatewayIntentWarnings; LogGatewayIntentWarnings = config.LogGatewayIntentWarnings;
HandlerTimeout = config.HandlerTimeout; HandlerTimeout = config.HandlerTimeout;
State = new ClientState(0, 0); State = new ClientState(0, 0);
Rest = new DiscordSocketRestClient(config, ApiClient); if (shardedClient is null || parentClient is null)
Rest = new DiscordSocketRestClient(config, ApiClient);
_heartbeatTimes = new ConcurrentQueue<long>(); _heartbeatTimes = new ConcurrentQueue<long>();
_gatewayIntents = config.GatewayIntents; _gatewayIntents = config.GatewayIntents;
_defaultStickers = ImmutableArray.Create<StickerPack<SocketSticker>>(); _defaultStickers = ImmutableArray.Create<StickerPack<SocketSticker>>();