mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-05 08:11:57 +02:00
sync with help sauf permission
This commit is contained in:
@@ -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
@@ -115,5 +115,6 @@
|
||||
"userinfo": 5,
|
||||
"bl": 10,
|
||||
"unbl": 10,
|
||||
"stat": 10
|
||||
"stat": 10,
|
||||
"random": 0
|
||||
}
|
||||
Reference in New Issue
Block a user