#Get correct count of all members that are not offline

4 messages · Page 1 of 1 (latest)

mellow vector
#

• 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.

river burrow
#

Imho it’s a mistake that discord exposes invisible state at all to bots. Since the purpose of invisible is appearing as offline for all intents and purposes…

river burrow
#

Do you have all members cached? As in did you <Guild>.members.fetch() once somewhere?

river burrow
#

That is API spam… you don’t need to fetch guilds at all, they are always cached with Guilds intent (but in your code the fetch isn’t forced so is got from cache anyway).
But the fetching of all members only needs to happen once on ready. After that the cache gets updated through gateway events anyway.