From b15f3aad6b7151aa8261ee0c49d2e0d3ee09b2f0 Mon Sep 17 00:00:00 2001 From: toast Date: Wed, 6 Dec 2023 22:13:05 +1100 Subject: [PATCH] Add WebSocket latency --- src/commands/ping.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/commands/ping.rs b/src/commands/ping.rs index 89c31e0..03da42d 100644 --- a/src/commands/ping.rs +++ b/src/commands/ping.rs @@ -2,9 +2,7 @@ use crate::Error; /// Check if the bot is alive #[poise::command(slash_command)] -pub async fn ping( - ctx: poise::Context<'_, (), Error>, -) -> Result<(), Error> { - ctx.reply("Powong!").await?; +pub async fn ping(ctx: poise::Context<'_, (), Error>) -> Result<(), Error> { + ctx.reply(format!("Powong! `{:?}`ms", ctx.ping().await.as_millis())).await?; Ok(()) }