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
d.js toolkit
d.js toolkitā€¢2y ago
ā€¢ 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.
! Lixqa
! Lixqaā€¢2y ago
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
d.js docs
d.js docsā€¢2y ago
event (event) Client#shardReconnecting Emitted when a shard is attempting to reconnect or re-identify.
! Lixqa
! Lixqaā€¢2y ago
Ah perfect I like you mister
d.js docs
d.js docsā€¢2y ago
event (event) Client#shardReady Emitted when a shard turns ready.
! Lixqa
! Lixqaā€¢16mo ago
šŸ‘Œ Give me some days ill test it when im home and then ill close this Seems to be fixed thank you
Want results from more Discord servers?
Add your server