From 212e3cf7c685fa88ecffda0857f50b9dd98e93d4 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 27 Jul 2025 18:23:38 +0200 Subject: [PATCH] feat(cmd/utils): adding ping command --- src/commands/utils/ping.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/commands/utils/ping.ts diff --git a/src/commands/utils/ping.ts b/src/commands/utils/ping.ts new file mode 100644 index 0000000..eec8d73 --- /dev/null +++ b/src/commands/utils/ping.ts @@ -0,0 +1,18 @@ +import { MessageFlags, SlashCommandBuilder } from 'discord.js'; + +export default { + data: new SlashCommandBuilder() + .setName('ping') + .setDescription('Show your latency'), + async execute(interaction: CommandInteraction) { + const time: number = Date.now(); + await interaction.reply({ + content: '🏓 | Pong!', + flags: MessageFlags.Ephemeral + }); + + await interaction.editReply({ + content: `⏱️ | Response latency: **${Date.now() - time}**ms` + }); + } +}