Routes.guildMembers only returns 1 member
Running into a strange issue with discord.js REST where I am only getting a single result for Routes.guildMembers(guildId) despite the server I am testing clearly having over 5k members.
Server Members Intent is enabled in discord dev portal.
when this runs the
response returns an array with a single user in it.
If anyone has any insights into where I migth be going wrong here, please let me know.14 Replies
- What's your exact discord.js
npm list discord.js and node node -v version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!node -v
v22.14.0
@discordjs/rest@2.5.1
discord-api-types@0.38.12
Is the guild members intent enabled in the bot dev site?
yep, its a personal project so I onyl have one application for it
just pulling data

Im getting the feeling maybe i need to wait some time? I enabled the intent a while ago.
booted the bot and rejoined the server and made a new secret key just to be sure.
The guild id could be the wrong one tho
have confirmed guildid is correct
only using 1 guild and its set in my .env
plus the only user it returns is actually in the guild
ohh good point
let me make sure im doign that correctly
bingo, thanks a heap, not a discord.js REST issue....
I just don't know how to structure a rest query properly :kekwcry:
Fixed Query:
{ query: params } prob would’ve been sufficientahh yep
thats simpler
You don’t want to just use the ws call to fetch all members?
Or are you not using a websocket?
yer building in a cloudflare worker
so no sockets
Got it
appreciate the help