feat(cmd/utils): adding ping command
This commit is contained in:
parent
bb7d5b2cf0
commit
212e3cf7c6
1 changed files with 18 additions and 0 deletions
18
src/commands/utils/ping.ts
Normal file
18
src/commands/utils/ping.ts
Normal file
|
|
@ -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`
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue