Browse Source

Fixed GetUsersAsync to use MaxUsersPerBatch const as limit instead of MaxMessagesPerBatch.

Requests are now returning up to 1000 guild user entities instead of the previous 100.
pull/1412/head
LtLi0n 5 years ago
parent
commit
ff8cb63f9f
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

@@ -343,7 +343,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
@@ -357,7 +357,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