| @@ -622,8 +622,8 @@ namespace Discord.API | |||||
| Preconditions.GreaterThan(args.AfterUserId, 0, nameof(args.AfterUserId)); | Preconditions.GreaterThan(args.AfterUserId, 0, nameof(args.AfterUserId)); | ||||
| options = RequestOptions.CreateOrClone(options); | options = RequestOptions.CreateOrClone(options); | ||||
| var limit = args.Limit.GetValueOrDefault(DiscordConfig.MaxUserReactionsPerBatch); | |||||
| var afterUserId = args.AfterUserId.GetValueOrDefault(0); | |||||
| int limit = args.Limit.GetValueOrDefault(DiscordConfig.MaxUserReactionsPerBatch); | |||||
| ulong afterUserId = args.AfterUserId.GetValueOrDefault(0); | |||||
| var ids = new BucketIds(channelId: channelId); | var ids = new BucketIds(channelId: channelId); | ||||
| Expression<Func<string>> endpoint = () => $"channels/{channelId}/messages/{messageId}/reactions/{emoji}?limit={limit}&after={afterUserId}"; | Expression<Func<string>> endpoint = () => $"channels/{channelId}/messages/{messageId}/reactions/{emoji}?limit={limit}&after={afterUserId}"; | ||||
| @@ -60,7 +60,7 @@ namespace Discord.Rest | |||||
| async (info, ct) => | async (info, ct) => | ||||
| { | { | ||||
| var args = new GetReactionUsersParams(); | var args = new GetReactionUsersParams(); | ||||
| func(args); | |||||
| args.Limit = info.PageSize; | |||||
| if (info.Position != null) | if (info.Position != null) | ||||
| args.AfterUserId = info.Position.Value; | args.AfterUserId = info.Position.Value; | ||||
| @@ -81,8 +81,8 @@ namespace Discord.Rest | |||||
| info.Position = lastPage.Max(x => x.Id); | info.Position = lastPage.Max(x => x.Id); | ||||
| return true; | return true; | ||||
| }, | }, | ||||
| start: arguments.AfterUserId.Value, | |||||
| count: arguments.Limit.Value | |||||
| start: arguments.AfterUserId.IsSpecified ? arguments.AfterUserId.Value : (ulong?)null, | |||||
| count: arguments.Limit.GetValueOrDefault(DiscordConfig.MaxUserReactionsPerBatch) | |||||
| ); | ); | ||||
| } | } | ||||