eximiabots-radiox/src/client/commands/help.js

35 lines
1.6 KiB
JavaScript
Raw Normal View History

2020-03-02 19:38:42 +00:00
module.exports = {
name: 'help',
2020-08-25 06:35:39 +00:00
description: 'Get help using bot',
2020-03-02 19:38:42 +00:00
permission: 'none',
category: 'info',
2021-08-18 22:52:16 +00:00
execute(interaction, client, Discord, command) {
2020-03-12 22:53:23 +00:00
let message = {};
2021-08-26 14:02:11 +00:00
const categories = [];
for (let i = 0; i < client.commands.size; i++) {
if (!categories.includes([...client.commands.values()][i].category)) categories.push([...client.commands.values()][i].category);
}
let commands = '';
for (let i = 0; i < categories.length; i++) {
commands += `**» ${categories[i].toUpperCase()}**\n${client.commands.filter(x => x.category === categories[i] && !x.omitFromHelp).map(x => `\`${x.name}\``).join(', ')}\n`;
}
2021-08-26 14:02:11 +00:00
message.helpTitle = client.messages.helpTitle.replace("%client.user.username%", client.user.username);
message.helpDescription = client.messages.helpDescription.replace("%commands%", commands);
2021-08-26 14:02:11 +00:00
const embed = new Discord.MessageEmbed()
.setTitle(message.helpTitle)
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
.setColor(client.config.embedColor)
.setDescription(message.helpDescription)
.setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')
2021-08-26 14:02:11 +00:00
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
2021-08-26 19:06:15 +00:00
interaction.reply({
embeds: [embed],
ephemeral: true
});
2020-03-02 19:38:42 +00:00
}
};