fix help command
This commit is contained in:
2 files changed
+21
-24
No files matched your search
+20
-23
@@ -83,35 +83,32 @@ module.exports = {
|
||||
let embed = new MessageEmbed()
|
||||
.setDescription(cmd.description)
|
||||
.setColor("GREEN")
|
||||
.addField(
|
||||
.setTitle(`How to use /${cmd.name} command`)
|
||||
|
||||
if (cmd.SlashCommand.options && cmd.SlashCommand.options[0].type == 1) {
|
||||
let description = `${cmd.description}\n\n**Usage**\n`;
|
||||
|
||||
for (let i = 0; i < cmd.SlashCommand.options.length; i++) {
|
||||
if (cmd.SlashCommand.options[i].type == 1) {
|
||||
let param = '';
|
||||
if (cmd.SlashCommand.options[i].options) {
|
||||
param = cmd.SlashCommand.options[i].options.length > 0 ? ' ' : '';
|
||||
for (let j = 0; j < cmd.SlashCommand.options[i].options.length; j++) {
|
||||
if (cmd.SlashCommand.options[i].options[j].required) param += `[${cmd.SlashCommand.options[i].options[j].name}] `
|
||||
}
|
||||
}
|
||||
description += `\`/${cmd.name} ${cmd.SlashCommand.options[i].name}${param}\`\n${cmd.SlashCommand.options[i].description}\n\n`
|
||||
}
|
||||
}
|
||||
embed.setDescription(description);
|
||||
} else {
|
||||
embed.addField(
|
||||
"Usage",
|
||||
`\`/${cmd.name}\`${cmd.usage ? " " + cmd.usage : ""}`,
|
||||
true
|
||||
)
|
||||
|
||||
for (let i = 0; i < cmd.SlashCommand.options.length; i++) {
|
||||
if (cmd.SlashCommand.options[i].type == 1) {
|
||||
let param = cmd.SlashCommand.options[i].options.length > 0 ? ' ' : '';
|
||||
for (let j = 0; j < cmd.SlashCommand.options[i].options.length; j++) {
|
||||
if (cmd.SlashCommand.options[i].options[j].required) param += `[${cmd.SlashCommand.options[i].options[j].name}] `
|
||||
}
|
||||
embed.addField(
|
||||
`/${cmd.name} ${cmd.SlashCommand.options[i].name}${param}`,
|
||||
`${cmd.SlashCommand.options[i].description}`,
|
||||
true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
embed.addField(
|
||||
"Permissions",
|
||||
"Member: " +
|
||||
cmd.permissions.member.join(", ") +
|
||||
"\nBot: " +
|
||||
cmd.permissions.channel.join(", "),
|
||||
true
|
||||
);
|
||||
|
||||
return interaction.send(embed);
|
||||
}
|
||||
} else if (args[0].name == 'settings') {
|
||||
|
||||
Reference in new issue
Block a user