UNPKG

dellusofbot

Version:

💋💖crée ton propre bot discord simplement en js 💖🤍 - package de retour en développement

30 lines (23 loc) • 1.16 kB
module.exports = { name: 'help', description: 'Liste toutes les commandes disponibles', aliases: ['aide'], execute(message, args, client) { const { commands } = client; if (!args.length) { const commandList = commands.map(command => command.name).join(', '); return message.channel.send(`📚 Commandes disponibles: ${commandList}\nUtilisez \`help [commande]\` pour plus d'infos sur une commande spécifique.`); } const name = args[0].toLowerCase(); const command = commands.get(name) || commands.find(c => c.aliases && c.aliases.includes(name)); if (!command) { return message.reply('❌ Cette commande n\'existe pas!'); } let helpText = `**Nom:** ${command.name}`; if (command.description) helpText += `\n**Description:** ${command.description}`; if (command.aliases) helpText += `\n**Alias:** ${command.aliases.join(', ')}`; if (command.usage) helpText += `\n**Usage:** ${message.client.prefix}${command.name} ${command.usage}`; if (command.cooldown) helpText += `\n**Cooldown:** ${command.cooldown} secondes`; message.channel.send(helpText); }, };