fix help command
This commit is contained in:
2 files changed
+21
-24
No files matched your search
+20
-23
@@ -83,34 +83,31 @@ module.exports = {
|
|||||||
let embed = new MessageEmbed()
|
let embed = new MessageEmbed()
|
||||||
.setDescription(cmd.description)
|
.setDescription(cmd.description)
|
||||||
.setColor("GREEN")
|
.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",
|
"Usage",
|
||||||
`\`/${cmd.name}\`${cmd.usage ? " " + cmd.usage : ""}`,
|
`\`/${cmd.name}\`${cmd.usage ? " " + cmd.usage : ""}`,
|
||||||
true
|
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);
|
return interaction.send(embed);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ const { MessageEmbed, MessageActionRow, MessageButton } = require('discord.js');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
name: "settings",
|
name: "settings",
|
||||||
debug: false,
|
debug: false,
|
||||||
description: "configure your server settings",
|
description: "Configure your server settings",
|
||||||
usage: "[opt] [action] [value]",
|
usage: "[opt] [action] [value]",
|
||||||
permissions: {
|
permissions: {
|
||||||
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
||||||
|
|||||||
Reference in new issue
Block a user