Skip to content

Commit 6039378

Browse files
authored
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
1 parent fad217e commit 6039378

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Discord.Net.WebSocket/DiscordSocketClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ private DiscordSocketClient(DiscordSocketConfig config, API.DiscordSocketApiClie
152152
LogGatewayIntentWarnings = config.LogGatewayIntentWarnings;
153153
HandlerTimeout = config.HandlerTimeout;
154154
State = new ClientState(0, 0);
155-
Rest = new DiscordSocketRestClient(config, ApiClient);
155+
if (shardedClient is null || parentClient is null)
156+
Rest = new DiscordSocketRestClient(config, ApiClient);
156157
_heartbeatTimes = new ConcurrentQueue<long>();
157158
_gatewayIntents = config.GatewayIntents;
158159
_defaultStickers = ImmutableArray.Create<StickerPack<SocketSticker>>();

0 commit comments

Comments
 (0)