mirror of
https://github.com/thedrewen/protojx-manager.git
synced 2026-03-23 05:01:54 +01:00
feat(command): refactor ping and status commands to use CommandDefinition type
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { ApplicationIntegrationType, ButtonInteraction, ButtonStyle, ChatInputCommandInteraction, CommandInteraction, ComponentType, ContainerBuilder, InteractionContextType, MessageFlags, SlashCommandBuilder } from "discord.js";
|
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()
|
data: new SlashCommandBuilder()
|
||||||
.setName('ping')
|
.setName('ping')
|
||||||
.setDescription('Pong again!')
|
.setDescription('Pong again!')
|
||||||
@@ -43,4 +44,6 @@ export default {
|
|||||||
interaction.reply({content: 'Ho !', flags: [MessageFlags.Ephemeral]})
|
interaction.reply({content: 'Ho !', flags: [MessageFlags.Ephemeral]})
|
||||||
}}
|
}}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default CommandDefinition;
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
import { ApplicationIntegrationType, ChatInputCommandInteraction, CommandInteraction, EmbedBuilder, InteractionContextType, SlashCommandBuilder } from "discord.js";
|
import { ApplicationIntegrationType, ChatInputCommandInteraction, CommandInteraction, EmbedBuilder, InteractionContextType, SlashCommandBuilder } from "discord.js";
|
||||||
import ping from "ping";
|
import ping from "ping";
|
||||||
import statusService from "../../services/status.service";
|
import statusService from "../../services/status.service";
|
||||||
|
import CommandDefinition from "./ping.command";
|
||||||
|
|
||||||
export default {
|
const cmd : CommandDefinition = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('status')
|
.setName('status')
|
||||||
.setDescription('Give statut of servers.')
|
.setDescription('Give statut of servers.')
|
||||||
@@ -30,4 +31,6 @@ export default {
|
|||||||
|
|
||||||
await interaction.editReply({embeds: [embed]});
|
await interaction.editReply({embeds: [embed]});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default cmd;
|
||||||
Reference in New Issue
Block a user