From 63386f49bd1ebc0e5d3813c5ad7b4d2a3f1475f9 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Tue, 7 Mar 2023 20:35:10 +0700 Subject: [PATCH] ping: Also show latency to Discord --- src/commands/neko.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/neko.ts b/src/commands/neko.ts index 0eb1183..f1bbc4f 100644 --- a/src/commands/neko.ts +++ b/src/commands/neko.ts @@ -15,7 +15,10 @@ export class Neko { description: "Ping me!", }) ping(interaction: CommandInteraction): void { - interaction.reply("Pong! ^._.^"); + + // Get ping from Discord API + const ping = interaction.client.ws.ping; + interaction.reply(`Pong! ^._.^, my latency to Discord is \`${ping}ms\`!`); } @Slash({