diff --git a/commands/help.js b/commands/help.js new file mode 100644 index 0000000..bbc41e3 --- /dev/null +++ b/commands/help.js @@ -0,0 +1,48 @@ +const { EmbedBuilder, StringSelectMenuBuilder, ActionRowBuilder } = require("discord.js") +module.exports = { + name: 'help', + description: 'Affiche la liste des commandes', + async execute(message, args, client) { + const embed = new EmbedBuilder() + .setColor('#0099ff') + .setTitle('Aide') + .setDescription('Sélectionnez une catégorie pour voir les commandes correspondantes.'); + + const embedCat1 = new EmbedBuilder() + .setColor('#0099ff') + .setTitle('Catégorie 1') + .setDescription('Commandes de la catégorie 1'); + + const embedCat2 = new EmbedBuilder() + .setColor('#0099ff') + .setTitle('Catégorie 2') + .setDescription('Commandes de la catégorie 2'); + + const menu = new StringSelectMenuBuilder() + .setCustomId('help_menu') + .setPlaceholder('Sélectionnez une catégorie') + .addOptions([ + { label: 'Accueil', value: 'home' }, + { label: 'Catégorie 1', value: 'cat1' }, + { label: 'Catégorie 2', value: 'cat2' }, + // Ajoutez plus d'options pour chaque catégorie de commandes + ]); + + const row = new ActionRowBuilder() + .addComponents(menu); + + const sentMessage = await message.reply({ embeds: [embed], components: [row] }); + + const filter = i => i.customId === 'help_menu' && i.user.id === message.author.id; + const collector = sentMessage.createMessageComponentCollector({ filter, time: 15000 }) + collector.on('collect', async (interaction) => { + if (interaction.values[0] === 'home') { + await interaction.update({ embeds: [embed] }); + } else if (interaction.values[0] === 'cat1') { + await interaction.update({ embeds: [embedCat1] }); + } else if (interaction.values[0] === 'cat2') { + await interaction.update({ embeds: [embedCat2] }); + } + }); + }, +}; \ No newline at end of file diff --git a/commands/utils/avatar.js b/commands/utils/avatar.js index e150a4f..3af08bc 100644 --- a/commands/utils/avatar.js +++ b/commands/utils/avatar.js @@ -17,7 +17,6 @@ module.exports = { } let avatar = user.avatarURL({dynamic : true, size : 1024}); - console.log(avatar); if (user.avatarURL({dynamic : true, size : 1024}) === null) { return message.reply('L\'utilisateur n\'a pas d\'avatar.'); } diff --git a/events/client/ready.js b/events/client/ready.js index 592c892..86f61fb 100644 --- a/events/client/ready.js +++ b/events/client/ready.js @@ -3,7 +3,7 @@ const { Events, ActivityType } = require("discord.js"); module.exports = { name: Events.ClientReady, async execute(client) { - console.log(`le bot ${client.user.id} est en ligne`) + console.log(`le bot ${client.user.tag} est en ligne`) } }; \ No newline at end of file