Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reaction getUsers does not return all of the users #79

Closed
julien777z opened this issue Oct 21, 2017 · 3 comments
Closed

Reaction getUsers does not return all of the users #79

julien777z opened this issue Oct 21, 2017 · 3 comments
Labels

Comments

@julien777z
Copy link
Contributor

p(reaction.count) --> correct number
p(#reaction:getUsers()) --> incorrect number
p(reaction:getUsers():count(function(r) return r end)) --> incorrect number

Since all of the users are not retrieved, iterating through them does not iterate through all of the users who reacted to the message.

@SinisterRectus
Copy link
Owner

Will fix ASAP. The issue is that this endpoint returns paginated results, but this was only recently documented. See discord/discord-api-docs#401.

@SinisterRectus
Copy link
Owner

Should be fixed by b9b181d.

@SinisterRectus
Copy link
Owner

SinisterRectus commented Oct 23, 2017

If more than 100 reaction users exist, you'll need to make multiple requests to get them all, and until I fix cache sorting, you'll have to semi-manually sort the users:

local users = reaction:getUsers():toArray('id')
local moreUsers = reaction:getUsersAfter(users[#users])

Each request returns up to 100 users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants