feat: ping command

This commit is contained in:
TresAbhi committed 2023-06-17 18:16:41 +00:00
1 parent 78d429808a
commit 78424c1535
2 files changed
+40 -6

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
import { SlashCommandBuilder } from 'discord.js';
import cmdName from '../core/interaction/cmdName.js';
import { CommandRegistry } from '../events/interactionCreate.js';
export default {
inProduction: true,
inDevelopment: true,
inPublic: true,
handlesInteraction: true,
command: new SlashCommandBuilder()
.setName(cmdName('ping'))
.setDescription('Check if the bot is alive'),
async execute(interaction) {
const executionStart = new Date().getTime();
await interaction.editReply('Pong 🏓');
const executionTime = new Date().getTime() - executionStart;
interaction.editReply(`Pong 🏓 - ${executionTime}ms`);
},
} satisfies CommandRegistry;