Bot status occasionally reverts back to initial status from the status set in ClientReady
Im using DJS with sharding. I initialize the client with a status of "Starting" and then in ClientReady I basically set the status to something else ("bla" in this case).
so pretty straight forward stuff.
However: if the bot is unattended for some time without restart, sometimes the activity resets back to "Starting..." and remains stuck there.
I assume that happens when some connection times our for a bit (shard?) but I'm not sure. Is there a way to "catch" that and set the status again?
Im not sure if its a sharding issue but would
Events.ShardResume
or something work? Is that a common issue?
---
npm list discord.js
: [email protected]
node -v
: v21.0.0
5 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!Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Nah I don't think an interval is a good solution. Since somehow the client options are re-set under a certain condition without calling ClientReady again, I assume the shard is re-initialized. Which means I should be able to set the status again by catching the ShardResume event. but since I can't really test that I thought I'd ask here first
the presence isn't static. ill give shardReady a try. whats the difference between that and shardResume?
alright, I see. thanks! :)
so, shardReady doesnt really work in my case because it fires with ClientReady which is why I do it with a preiodic check like @gwapes suggested now