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 { EmbedBuilder, StringSelectMenuBuilder, ActionRowBuilder } = require("discord.js")
const db = require('quick.db'); const db = require('quick.db');
const GestionDb = new db.table("gestion"); const GestionDb = new db.table("gestion");
module.exports = { module.exports = {
name: 'help', name: 'help',
description: 'Affiche la liste des commandes', description: 'Affiche la liste des commandes',
@@ -9,6 +10,8 @@ module.exports = {
utilisation: 'help [commande]', utilisation: 'help [commande]',
async execute(message, args, client) { async execute(message, args, client) {
const botId = client.user.id; const botId = client.user.id;
const botInfo = GestionDb.get(botId);
const permissions = botInfo.permissions;
const guildId = message.guild.id; const guildId = message.guild.id;
const defaultprefix = "+"; const defaultprefix = "+";
let mainPrefix = await GestionDb.get(`${botId}.prefix`); let mainPrefix = await GestionDb.get(`${botId}.prefix`);
@@ -20,13 +23,16 @@ module.exports = {
return message.reply(`Je n'ai pas trouvé de commande nommée "${args[0]}".`); return message.reply(`Je n'ai pas trouvé de commande nommée "${args[0]}".`);
} }
const embed_command = new EmbedBuilder() const embed_command = new EmbedBuilder()
.setColor('#0099ff') .setColor('#0099ff')
.setTitle(`Aide pour la commande ${command.emote ? ` ${command.emote}` : '🔧'} ${command.name}`) .setTitle(`Aide pour la commande ${command.emote ? ` ${command.emote}` : '🔧'} ${command.name}`)
.setDescription(command.description) .setDescription(command.description)
.addFields( .addFields(
{ name: 'Utilisation', value: `\`${prefix}${command.utilisation ? `${command.utilisation}` : ''}\``, inline: true }, { 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() .setTimestamp()
.setFooter({text: `${client.user.tag} © 2024`, iconURL: client.user.displayAvatarURL({dynamic: true})}) .setFooter({text: `${client.user.tag} © 2024`, iconURL: client.user.displayAvatarURL({dynamic: true})})
@@ -52,7 +58,6 @@ module.exports = {
liste.push(command); liste.push(command);
} }
} }
console.log(liste);
for (const command of liste) { for (const command of liste) {
if (command.category) { if (command.category) {
categories[command.category].push({ name: command.name, description: command.description, emote: command.emote, utilisation: command.utilisation}); 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, "userinfo": 5,
"bl": 10, "bl": 10,
"unbl": 10, "unbl": 10,
"stat": 10 "stat": 10,
"random": 0
} }