#guild.members.fetch() limit

9 messages · Page 1 of 1 (latest)

mental gate
#

The discord API documentation states the limit for fetching guild members is 1000 (reference: https://discord.com/developers/docs/resources/guild#list-guild-members) and uses an after query parameter to determine the pagination index, but does discord.js implement this and concatenate the results of multiple API calls for large servers as the return value for this function when no options are provided, implying all guild members should be fetched?

spring patrol
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

feral violet
#

Definitely not, no

mental gate
#

Makes sense. Just wanted to make sure since there is no after parameter available for any of the fetchOptions

feral violet
#

The List Guild Members endpoint is GuildMemberManager#list() and takes GuildListMembersOptions - are you sure you're looking at the right method?

mental gate
#

I see where I went wrong haha, I assumed fetch would use the /list endpoint, but GuildMemberManager#fetch({ user: ['id1', 'id2', 'etc.'] }) would perform the fetch single member request for every individual id instead, right? If it's not already cached of course.

mental gate
#

Thanks for clearing it all up, makes a lot more sense now praydge