Refactor command handling to use CommandDefinition type and improve interaction processing

This commit is contained in:
2025-10-29 15:41:41 +01:00
parent 433e8ee2f0
commit 83fcb68955
3 changed files with 24 additions and 8 deletions

View File

@@ -1,10 +1,13 @@
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
import { CommandDefinition } from "../../type";
export default {
const cmd : CommandDefinition = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Pong again!'),
async execute(interaction : ChatInputCommandInteraction) {
await interaction.reply('Pong !');
}
}
}
export default cmd;