From 6c71e7e9b48ae4c868ee213891024422655e4819 Mon Sep 17 00:00:00 2001 From: Tutur33 Date: Sat, 17 Feb 2024 02:30:55 +0100 Subject: [PATCH] sync with help sauf permission --- commands/utils/help.js | 9 +++++++-- permissions.json | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/commands/utils/help.js b/commands/utils/help.js index 9ba1491..69014f0 100644 --- a/commands/utils/help.js +++ b/commands/utils/help.js @@ -1,6 +1,7 @@ const { EmbedBuilder, StringSelectMenuBuilder, ActionRowBuilder } = require("discord.js") const db = require('quick.db'); const GestionDb = new db.table("gestion"); + module.exports = { name: 'help', description: 'Affiche la liste des commandes', @@ -9,6 +10,8 @@ module.exports = { utilisation: 'help [commande]', async execute(message, args, client) { const botId = client.user.id; + const botInfo = GestionDb.get(botId); + const permissions = botInfo.permissions; const guildId = message.guild.id; const defaultprefix = "+"; let mainPrefix = await GestionDb.get(`${botId}.prefix`); @@ -19,6 +22,7 @@ module.exports = { if (!command) { return message.reply(`Je n'ai pas trouvé de commande nommée "${args[0]}".`); } + const embed_command = new EmbedBuilder() .setColor('#0099ff') @@ -26,7 +30,9 @@ module.exports = { .setDescription(command.description) .addFields( { name: 'Utilisation', value: `\`${prefix}${command.utilisation ? `${command.utilisation}` : ''}\``, inline: true }, - { name: 'Catégorie', value: command.category || 'Non spécifiée', inline: true } + { name: 'Catégorie', value: command.category || 'Non spécifiée', inline: true }, + { name: 'Alias', value: command.aliases ? command.aliases.map(alias => `\`${alias}\``).join(', ') : 'Aucun', inline: true }, + { name: 'Permissions', value: permissions[command.name] || 'Indéfini', inline: true } ) .setTimestamp() .setFooter({text: `${client.user.tag} © 2024`, iconURL: client.user.displayAvatarURL({dynamic: true})}) @@ -52,7 +58,6 @@ module.exports = { liste.push(command); } } - console.log(liste); for (const command of liste) { if (command.category) { categories[command.category].push({ name: command.name, description: command.description, emote: command.emote, utilisation: command.utilisation}); diff --git a/permissions.json b/permissions.json index 87c2496..2cc0e63 100644 --- a/permissions.json +++ b/permissions.json @@ -115,5 +115,6 @@ "userinfo": 5, "bl": 10, "unbl": 10, - "stat": 10 + "stat": 10, + "random": 0 } \ No newline at end of file