mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-25 06:33:04 +02:00
sync with help sauf permission
This commit is contained in:
@@ -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`);
|
||||||
@@ -19,6 +22,7 @@ module.exports = {
|
|||||||
if (!command) {
|
if (!command) {
|
||||||
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')
|
||||||
@@ -26,7 +30,9 @@ module.exports = {
|
|||||||
.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
@@ -115,5 +115,6 @@
|
|||||||
"userinfo": 5,
|
"userinfo": 5,
|
||||||
"bl": 10,
|
"bl": 10,
|
||||||
"unbl": 10,
|
"unbl": 10,
|
||||||
"stat": 10
|
"stat": 10,
|
||||||
|
"random": 0
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user