Browse Source

fix: GetUsersAsync to use MaxUsersPerBatch const as limit instead of MaxMessagesPerBatch. (#1412)

Requests are now returning up to 1000 guild user entities instead of the previous 100.
tags/2.2.0
Saulius Šaltenis Christopher F 5 years ago
parent
commit
5439cbad5a
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs

+ 2
- 2
src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs View File

@@ -349,7 +349,7 @@ namespace Discord.Rest
ulong? fromUserId, int? limit, RequestOptions options)
{
return new PagedAsyncEnumerable<RestGuildUser>(
DiscordConfig.MaxMessagesPerBatch,
DiscordConfig.MaxUsersPerBatch,
async (info, ct) =>
{
var args = new GetGuildMembersParams
@@ -363,7 +363,7 @@ namespace Discord.Rest
},
nextPage: (info, lastPage) =>
{
if (lastPage.Count != DiscordConfig.MaxMessagesPerBatch)
if (lastPage.Count != DiscordConfig.MaxUsersPerBatch)
return false;
info.Position = lastPage.Max(x => x.Id);
return true;


Loading…
Cancel
Save