Trying to detect if a shard goes offline
I am trying to make it so on shardcreate it gets the client.ws.ping or client.ws.status.
The issue is that when I disconnect my wifi it still returns 0 for the status (same as when its on and connected), and the ping remains frozen at the last value (Not switching to -1 like I would expect)
Here Is the code(I am using express to send a thing based on if its running or not):
Also again client.ws.status cant be compared to WebSocket.OPEN since its always 0
This whole setup is so that I can monitor the bot by pinging it eventually but I cant detect if its on like this, how would I do this?
1 Reply
- 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!