#Getting bot latency in Serenity

5 messages · Page 1 of 1 (latest)

gleaming oriole
#

Is there any way or method of getting the latency of a bot with the crate Serenity? I want to implement this in to a ping command. Which, I have tried looking around Google for a solution but got nothing useful.

whole citrus
# gleaming oriole Is there any way or method of getting the latency of a bot with the crate Sereni...

the message of the command will have a timestamp subtract the current date from the message timestamp to get the one way latency. double that time to get an overall estimated response time. you can also use latency command on a shard to get the latency between the shard and the gateway to get the bot's own response time depending on exactly what you want.
https://docs.rs/serenity/latest/serenity/gateway/struct.Shard.html#method.latency
https://docs.rs/serenity/latest/serenity/model/channel/struct.Message.html

gleaming oriole
#

Ah. Thank you.

gleaming oriole