Inaccurate ping measurement with client.ws.ping
Every time I pull from client.ws.ping, it outputs -1, regardless of the connection I'm on or the speed at which it's running. Is there a reason for this? This has been happening to me for as long as I've been familiar with discord.js (I think since v11)
8 Replies
that means the first heartbeat hasn't been received, it won't be -1 past the first minute
So the bot recieves a hearbeat every minute?
technically it's not known, since the heartbeat interval is part of the data received while connecting, it's not hardcoded
but afaik it's usually somewhere around 40s
So there's no way to use an eventlistener for it then
for the heartbeat?
yeah
I just found you can use
Showed
Heartbeat: [WS => Shard 0] Heartbeat acknowledged, latency of 30ms.
The thread owner has marked this issue as solved.