* Move REST requests to appropiate class * Add call to ClientHelper and expose to public API * Expose shard count request in public api * Expose method from interface * Update sharded client to utilize the new method * Method is already implemented in a base class * Refactor name to fit pattern for methods returning a `Task` * Adds missing ConfigureAwait * Corrects unnecessary whitespace * Removes unneeded whitespace
This commit is contained in:
committed by
Christopher F
parent
f175dde2b3
commit
fc5e70c9dd
@@ -1,4 +1,4 @@
|
||||
using Discord.API;
|
||||
using Discord.API;
|
||||
using Discord.Rest;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -75,8 +75,8 @@ namespace Discord.WebSocket
|
||||
{
|
||||
if (_automaticShards)
|
||||
{
|
||||
var response = await ApiClient.GetBotGatewayAsync().ConfigureAwait(false);
|
||||
_shardIds = Enumerable.Range(0, response.Shards).ToArray();
|
||||
var shardCount = await GetRecommendedShardCountAsync().ConfigureAwait(false);
|
||||
_shardIds = Enumerable.Range(0, shardCount).ToArray();
|
||||
_totalShards = _shardIds.Length;
|
||||
_shards = new DiscordSocketClient[_shardIds.Length];
|
||||
for (int i = 0; i < _shardIds.Length; i++)
|
||||
|
||||
Reference in New Issue
Block a user