sync with help sauf permission

This commit is contained in:
Tutur33
2024-02-17 02:30:55 +01:00
parent 8bc2bbb8d8
commit 6c71e7e9b4
2 changed files with 9 additions and 3 deletions
+7 -2
View File
@@ -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});
+2 -1
View File
@@ -115,5 +115,6 @@
"userinfo": 5,
"bl": 10,
"unbl": 10,
"stat": 10
"stat": 10,
"random": 0
}