#Getting bot latency in Serenity
5 messages · Page 1 of 1 (latest)
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
A representation of a message over a guild’s text channel, a group, or a private channel.
A Shard is a higher-level handler for a websocket connection to Discord’s gateway. The shard allows for sending and receiving messages over the websocket, such as setting the active activity, reconnecting, syncing guilds, and more.
Ah. Thank you.
Right so, whenever I use the timestamp method it does return a timestamp however the timestamp shows as this 2023-02-04T13:59:13.081Z, is it possible to instead get the timestamp in milliseconds/seconds/etc or convert it to one of those?
https://docs.rs/serenity/latest/serenity/model/timestamp/struct.Timestamp.html#
timestamp.timestamp_millis()
Representation of a Unix timestamp.