LanDiscordScrapy/commands/core/help.js

25 lines
782 B
JavaScript
Raw Normal View History

2022-03-04 14:26:14 +01:00
const { MessageEmbed } = require('discord.js');
module.exports = {
name: 'help',
aliases: ['h'],
showHelp: false,
utilisation: '{prefix}help',
execute(client, message, args) {
const embed = new MessageEmbed();
embed.setColor('RED');
embed.setAuthor(client.user.username, client.user.displayAvatarURL({ size: 1024, dynamic: true }));
const commands = client.commands.filter(x => x.showHelp !== false);
embed.setDescription('Bienvenue sur la page d\'aide !');
embed.addField(`Actifs - ${commands.size}`, commands.map(x => `\`${x.name}${x.aliases[0] ? ` (${x.aliases.map(y => y).join(', ')})\`` : '\`'}`).join(' | '));
embed.setTimestamp();
message.channel.send({ embeds: [embed] });
},
};