Renamed existing Flatten method to FlattenAsync and added new Flatten method. Also fixed ClientHelper using incorrect guild batch count. (#744)

This commit is contained in:
ObsidianMinor
2018-01-06 21:43:11 -06:00
committed by Christopher F
parent edfbd055bb
commit 5bbd9bba82
4 changed files with 63 additions and 11 deletions

View File

@@ -79,7 +79,7 @@ namespace Discord.Rest
ulong? fromGuildId, int? limit, RequestOptions options)
{
return new PagedAsyncEnumerable<RestUserGuild>(
DiscordConfig.MaxUsersPerBatch,
DiscordConfig.MaxGuildsPerBatch,
async (info, ct) =>
{
var args = new GetGuildSummariesParams
@@ -106,7 +106,7 @@ namespace Discord.Rest
}
public static async Task<IReadOnlyCollection<RestGuild>> GetGuildsAsync(BaseDiscordClient client, RequestOptions options)
{
var summaryModels = await GetGuildSummariesAsync(client, null, null, options).Flatten();
var summaryModels = await GetGuildSummariesAsync(client, null, null, options).FlattenAsync().ConfigureAwait(false);
var guilds = ImmutableArray.CreateBuilder<RestGuild>();
foreach (var summaryModel in summaryModels)
{