fix bug : le niveau de permission aux commandes d'aide

This commit is contained in:
Tutur33
2024-02-17 16:54:32 +01:00
parent 613a4bce87
commit 0609007827
2 changed files with 38 additions and 4 deletions
+33
View File
@@ -0,0 +1,33 @@
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'botstat',
aliases: ['botstats'],
description: 'Affiche les statistiques du bot.',
emote: '🔍',
utilisation: 'botstat',
category: 'utils',
async execute(message, args, client) {
const guilds = client.guilds.cache.size;
const channels = client.channels.cache.size;
const users = client.users.cache.size;
const emojis = client.emojis.cache.size;
const embed = new EmbedBuilder()
.setColor("#FFFFFF")
.setTitle(`🔍 statistiques du bot \`${client.user.username}\``)
.setThumbnail(client.user.displayAvatarURL({dynamic: true}))
.addFields([
{ name: '🏰 Total Serveurs', value: `\`${guilds}\``, inline: true },
{ name: '🆔 Total salons', value: `\`${channels}\``, inline: true },
{ name: '👨‍💻 Total Utilisateurs', value: `\`${users}\``, inline: true },
{ name: '🤖 Total émojis', value: `\`${emojis}\``, inline: true },
])
.setTimestamp()
.setFooter({text: `${client.user.tag} © 2024`, iconURL: client.user.displayAvatarURL({dynamic: true})});
message.reply({ embeds: [embed] });
},
};
+5 -4
View File
@@ -25,7 +25,8 @@ 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 commandPerm = await permissions[command.name];
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}`)
@@ -34,12 +35,12 @@ module.exports = {
{ 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: 'Alias', value: command.aliases ? command.aliases.map(alias => `\`${alias}\``).join(', ') : 'Aucun', inline: true },
{ name: 'Permissions', value: permissions[command.name] || 'Indéfini', inline: true } { name: 'Permissions', value: `Perm level: ${commandPerm}` || '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})})
return message.reply({ embeds: [embed_command] }); return message.reply({ embeds: [embed_command] });
} }