diff --git a/src/commands/misc/help.ts b/src/commands/misc/help.ts new file mode 100644 index 0000000..6a8a109 --- /dev/null +++ b/src/commands/misc/help.ts @@ -0,0 +1,34 @@ +import { SlashCommandBuilder } from '@discordjs/builders'; +import { Client, CommandInteraction, MessageEmbed } from 'discord.js'; +import { getLocale, getLocalizations } from '../../utils/locales'; +import { getFilename } from '../../utils/misc'; + +export default { + data: (client: Client) => { + const filename = getFilename(__filename); + return new SlashCommandBuilder() + .setName(filename.toLowerCase()) + .setDescription(client.locales.get(client.config.default_lang)?.get(`c_${filename}_desc`) ?? '?') + .setNameLocalizations(getLocalizations(client, `c_${filename}_name`)) + .setDescriptionLocalizations(getLocalizations(client, `c_${filename}_desc`)); + }, + + interaction: async (interaction: CommandInteraction, client: Client) => { + const loc = getLocale(client, interaction.locale); + const command_name = interaction.options.getString('command'); + + // If a command is specified + if (command_name) { + // Check if command exists + interaction.reply({ content: 'WIP', ephemeral: true }); + } else { + const embed = new MessageEmbed() + .setColor('BLURPLE') + .setTitle(loc.get('c_help1')) + .setDescription(loc.get('c_help2')) + .addField('WIP', 'WIP'); + + interaction.reply({ embeds: [embed] }); + } + }, +}; diff --git a/src/locales/fr.json b/src/locales/fr.json index 24f0dbe..af66a14 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -3,5 +3,8 @@ "c_ping_desc": "Pong!", "c_ping1": "Latence totale", - "c_ping2": "Latence du Websocket" + "c_ping2": "Latence du Websocket", + + "c_help1": "Liste des catégories et des commandes associées", + "c_help2": "`/help ` pour obtenir plus d'informations sur une commande." }