cache expires?
Hi i have a feature in my bot that runs in a interval every 30min. Its something like that:
guild.roles.cache.get(....).memberCount
But i noticed, that always after ~2 days the role and memberCount becomes null.
Does the cache expire? Or am i just dumb?
6 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.Im currently not on pc. I meant role.members.size
No
Yes
Its working 2 days everytime, then it shows 0. I have to restart bot
Ready event is once
Ouh
So i should do ready to on instead once?
Thats smart, ill try it thanks
Or is there a way to detect the "reconnect" and refetch then
Because my ready event does a bunch of other stuff. Maybe it would cause problems if it runs while the bot is already online (On my systems)
Or wait. I can just use multiple ready events. .once and .on
Lol
Ah perfect
I like you mister
👌
Give me some days ill test it when im home and then ill close this
Seems to be fixed thank you