Cache of GuildMembers
Hi, how long does it take for the bot to delete members from cache? For get some full members of some roles i put this code in 'ready' events. When bot starts,
guild.members.size
returned 100% memberCount but some time latter (about half day), it returns only 20-30% of memberCount. Is there any way to keep the cache always full. I just only want to get full members of some roles at anytime more and than that the presence of the member
Client Options:
11 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!Just fetch when you actually need the members
i fetched but it return null and 'Unkown Member' error
And how are you fetching?
i wanna get all members of a role but someone told me in #djs-help-v14 that the all the members of this role must be cached so i tried to use this
but
role.members
doesnt return full members of that roleI don't see where you're fetching members in that code
I see you fetching a guild and I see you fetching a role from that guild, but not members
also, according to your previous code, you have the Guilds intent, in which case fetching guilds and roles is unnecessary
if the member of a role wasn't in the cache, will
role.members
return full member having that role?it relies on member cache
So no, if the member isnt cached they won't be included
so how can i get full member of specific role
by fetching guild members first