2020-03-02 19:38:42 +00:00
|
|
|
module.exports = {
|
|
|
|
name: 'help',
|
|
|
|
alias: 'h',
|
|
|
|
usage: '<command(opt)>',
|
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 = {};
|
2020-03-22 15:10:46 +00:00
|
|
|
|
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`;
|
|
|
|
}
|
2020-03-22 15:10:46 +00:00
|
|
|
|
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);
|
2020-03-22 15:10:46 +00:00
|
|
|
|
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)
|
|
|
|
.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
|
|
|
}
|
|
|
|
};
|