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` + }); + } +}