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.
This commit is contained in:
committed by
Christopher F
parent
f86c39de6a
commit
5439cbad5a
@@ -349,7 +349,7 @@ namespace Discord.Rest
|
|||||||
ulong? fromUserId, int? limit, RequestOptions options)
|
ulong? fromUserId, int? limit, RequestOptions options)
|
||||||
{
|
{
|
||||||
return new PagedAsyncEnumerable<RestGuildUser>(
|
return new PagedAsyncEnumerable<RestGuildUser>(
|
||||||
DiscordConfig.MaxMessagesPerBatch,
|
DiscordConfig.MaxUsersPerBatch,
|
||||||
async (info, ct) =>
|
async (info, ct) =>
|
||||||
{
|
{
|
||||||
var args = new GetGuildMembersParams
|
var args = new GetGuildMembersParams
|
||||||
@@ -363,7 +363,7 @@ namespace Discord.Rest
|
|||||||
},
|
},
|
||||||
nextPage: (info, lastPage) =>
|
nextPage: (info, lastPage) =>
|
||||||
{
|
{
|
||||||
if (lastPage.Count != DiscordConfig.MaxMessagesPerBatch)
|
if (lastPage.Count != DiscordConfig.MaxUsersPerBatch)
|
||||||
return false;
|
return false;
|
||||||
info.Position = lastPage.Max(x => x.Id);
|
info.Position = lastPage.Max(x => x.Id);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user