From 5439cbad5af1f04f7d4fe6103953059eb2d000cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saulius=20=C5=A0altenis?= <31516441+LtLi0n@users.noreply.github.com> Date: Sat, 9 Nov 2019 20:38:25 +0200 Subject: [PATCH] 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. --- src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs b/src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs index 05a520547..7730a9cc3 100644 --- a/src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs +++ b/src/Discord.Net.Rest/Entities/Guilds/GuildHelper.cs @@ -349,7 +349,7 @@ namespace Discord.Rest ulong? fromUserId, int? limit, RequestOptions options) { return new PagedAsyncEnumerable( - 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;