Browse Source

Update sharded client to utilize the new method

pull/962/head
Darnell Williams 7 years ago
parent
commit
1e9d2d5c68
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/Discord.Net.WebSocket/DiscordShardedClient.cs

+ 3
- 3
src/Discord.Net.WebSocket/DiscordShardedClient.cs View File

@@ -1,4 +1,4 @@
using Discord.API;
using Discord.API;
using Discord.Rest; using Discord.Rest;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -75,8 +75,8 @@ namespace Discord.WebSocket
{ {
if (_automaticShards) if (_automaticShards)
{ {
var response = await ApiClient.GetBotGatewayAsync().ConfigureAwait(false);
_shardIds = Enumerable.Range(0, response.Shards).ToArray();
var shardCount = await GetRecommendedShardCount().ConfigureAwait(false);
_shardIds = Enumerable.Range(0, shardCount).ToArray();
_totalShards = _shardIds.Length; _totalShards = _shardIds.Length;
_shards = new DiscordSocketClient[_shardIds.Length]; _shards = new DiscordSocketClient[_shardIds.Length];
for (int i = 0; i < _shardIds.Length; i++) for (int i = 0; i < _shardIds.Length; i++)


Loading…
Cancel
Save