Why it doesn't show the right member online?
I've checked this in my server (the photo shows below), and it is not as same as with what Discord actually show all online members.
Here's the code:
17 Replies
• 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.
Tag suggestion for @harshfeudal:
Getting your bot's member count
• client.users.cache.size
is unreliable because it will only return cached users
• The preferred method is using collection.reduce()
on client.guilds.cache
i did that before, as I've asked, and it still show the same with this way, so idk :(
1) You need
GUILD_MEMBERS
and GUILD_PRESENCES
intents
2) You should fetch all members
3) Online members can have dnd
or idle
statusesi use admin intents
4) The presence can exist with offline status
It's permission, not intent
Tag suggestion for @harshfeudal:
• Websocket intents limit events and decrease memory usage: learn more
• See what intents you need here
Tag suggestion for @harshfeudal:
We highly recommend only specifying the intents you actually need.
• Note, that
98303
, 32767
or whatever other magic number you read represents "all intents", somewhere, gets outdated as soon as new intents are introduced.
• The number will always represent the same set of intents, excluding new ones, there is no magic "all intents" bit.hmm okay
it's correct in small server, but it doesn't in larger one :(
your code relies on the cache and does not fetch members
as said here (reply)
no i have fixed
and fix intents too
i've just checked, all servers can, but idk why it's always missing 4 members online in my server :( all others can get all
ive checked, my bot has updated members online more faster than Discord. What I look onto Discord stats is the stable number one, however my bot update every second.