• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

EN client.getPing() returning cached result?

Fabeyy

Active Member
Contributor
Hey there,
I'm currently writing a script that relies on the Ping of a User being up-to-date all the time.
I noticed that that's not the case with the getPing() method, since it's returning a old Ping value even if the Ping of the User has changed already.
So my question is, does the method return a cached result for x calls or x seconds and if yes, is there a possibility to force a fresh fetch?
If no, why is the method returning old Ping values?

Kann auch gerne auf deutsch geantwortet werden :)
 

flyth

is reticulating splines
Staff member
Developer
Contributor
Currently there's no way to force a refresh. Getting the latency of a specific client is an expensive operation as it requires the bot to ask the server about it. It should update once every two minutes or after a longer interval if there are MANY people on the server.
 

Fabeyy

Active Member
Contributor
Currently there's no way to force a refresh. Getting the latency of a specific client is an expensive operation as it requires the bot to ask the server about it. It should update once every two minutes or after a longer interval if there are MANY people on the server.
That's unfortunate to hear but good to know, thanks!
A force-refresh method or the option to customize this update interval would be awesome ;)
 
Top