From 9cadfb273475535967c886037950f2eb8f653b3b Mon Sep 17 00:00:00 2001 From: CL TheDreWen Date: Wed, 29 Oct 2025 15:47:33 +0100 Subject: [PATCH] feat(command): refactor ping and status commands to use CommandDefinition type --- src/commands/utility/ping.command.ts | 7 +++++-- src/commands/utility/statut.command.ts | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/commands/utility/ping.command.ts b/src/commands/utility/ping.command.ts index 465fb83..3531659 100644 --- a/src/commands/utility/ping.command.ts +++ b/src/commands/utility/ping.command.ts @@ -1,6 +1,7 @@ import { ApplicationIntegrationType, ButtonInteraction, ButtonStyle, ChatInputCommandInteraction, CommandInteraction, ComponentType, ContainerBuilder, InteractionContextType, MessageFlags, SlashCommandBuilder } from "discord.js"; +import { CommandDefinition } from "../../type"; -export default { +const cmd : CommandDefinition = { data: new SlashCommandBuilder() .setName('ping') .setDescription('Pong again!') @@ -43,4 +44,6 @@ export default { interaction.reply({content: 'Ho !', flags: [MessageFlags.Ephemeral]}) }} ] -} \ No newline at end of file +} + +export default CommandDefinition; \ No newline at end of file diff --git a/src/commands/utility/statut.command.ts b/src/commands/utility/statut.command.ts index 04dbd20..d7f60d2 100644 --- a/src/commands/utility/statut.command.ts +++ b/src/commands/utility/statut.command.ts @@ -1,8 +1,9 @@ import { ApplicationIntegrationType, ChatInputCommandInteraction, CommandInteraction, EmbedBuilder, InteractionContextType, SlashCommandBuilder } from "discord.js"; import ping from "ping"; import statusService from "../../services/status.service"; +import CommandDefinition from "./ping.command"; -export default { +const cmd : CommandDefinition = { data: new SlashCommandBuilder() .setName('status') .setDescription('Give statut of servers.') @@ -30,4 +31,6 @@ export default { await interaction.editReply({embeds: [embed]}); } -} \ No newline at end of file +} + +export default cmd; \ No newline at end of file