Browse Source

Refactor name to fit pattern for methods returning a `Task`

pull/962/head
Darnell Williams 7 years ago
parent
commit
95d85bcad2
4 changed files with 5 additions and 5 deletions
  1. +1
    -1
      src/Discord.Net.Core/IDiscordClient.cs
  2. +2
    -2
      src/Discord.Net.Rest/BaseDiscordClient.cs
  3. +1
    -1
      src/Discord.Net.Rest/ClientHelper.cs
  4. +1
    -1
      src/Discord.Net.WebSocket/DiscordShardedClient.cs

+ 1
- 1
src/Discord.Net.Core/IDiscordClient.cs View File

@@ -37,6 +37,6 @@ namespace Discord

Task<IWebhook> GetWebhookAsync(ulong id, RequestOptions options = null);

Task<int> GetRecommendedShardCount(RequestOptions options = null);
Task<int> GetRecommendedShardCountAsync(RequestOptions options = null);
}
}

+ 2
- 2
src/Discord.Net.Rest/BaseDiscordClient.cs View File

@@ -126,8 +126,8 @@ namespace Discord.Rest
public void Dispose() => Dispose(true);

/// <inheritdoc />
public Task<int> GetRecommendedShardCount(RequestOptions options = null)
=> ClientHelper.GetRecommendShardCount(this, options);
public Task<int> GetRecommendedShardCountAsync(RequestOptions options = null)
=> ClientHelper.GetRecommendShardCountAsync(this, options);

//IDiscordClient
ConnectionState IDiscordClient.ConnectionState => ConnectionState.Disconnected;


+ 1
- 1
src/Discord.Net.Rest/ClientHelper.cs View File

@@ -164,7 +164,7 @@ namespace Discord.Rest
return models.Select(x => RestVoiceRegion.Create(client, x)).FirstOrDefault(x => x.Id == id);
}

public static async Task<int> GetRecommendShardCount(BaseDiscordClient client, RequestOptions options)
public static async Task<int> GetRecommendShardCountAsync(BaseDiscordClient client, RequestOptions options)
{
var response = await client.ApiClient.GetBotGatewayAsync(options);
return response.Shards;


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

@@ -75,7 +75,7 @@ namespace Discord.WebSocket
{
if (_automaticShards)
{
var shardCount = await GetRecommendedShardCount().ConfigureAwait(false);
var shardCount = await GetRecommendedShardCountAsync().ConfigureAwait(false);
_shardIds = Enumerable.Range(0, shardCount).ToArray();
_totalShards = _shardIds.Length;
_shards = new DiscordSocketClient[_shardIds.Length];


Loading…
Cancel
Save