Move help from fields to the description.
All checks were successful
NodBot Production Dockerization / build (pull_request) Successful in 1m7s
All checks were successful
NodBot Production Dockerization / build (pull_request) Successful in 1m7s
This commit is contained in:
parent
0c2eae76aa
commit
f231df89d8
32
functions.js
32
functions.js
@ -210,31 +210,23 @@ const functions = {
|
|||||||
const helpEmbed = new Discord.MessageEmbed()
|
const helpEmbed = new Discord.MessageEmbed()
|
||||||
.setColor('BLUE')
|
.setColor('BLUE')
|
||||||
.setAuthor({name: 'Help Page'})
|
.setAuthor({name: 'Help Page'})
|
||||||
.setDescription(strings.help.description)
|
|
||||||
.setThumbnail(strings.urls.avatar);
|
.setThumbnail(strings.urls.avatar);
|
||||||
|
|
||||||
// Construct the Slash Commands help
|
// Construct the Slash Commands help
|
||||||
|
|
||||||
let slashCommandsFields = [];
|
let slashCommandsFields = [];
|
||||||
|
|
||||||
const slashCommandsMap = interaction.client.slashCommands.map(e => {
|
const slashCommandsMap = interaction.client.slashCommands.map(e => {
|
||||||
return {
|
return {
|
||||||
name: e.data.name,
|
name: e.data.name,
|
||||||
description: e.data.description
|
description: e.data.description
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
for (const e of slashCommandsMap) {
|
for (const e of slashCommandsMap) {
|
||||||
slashCommandsFields.push({
|
slashCommandsFields.push(`- /${e.name} - ${e.description}`);
|
||||||
name: `- /${e.name}`,
|
|
||||||
value: e.description,
|
|
||||||
inline: false,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct the Dot Commands Help
|
// Construct the Dot Commands Help
|
||||||
let dotCommandsFields = [];
|
let dotCommandsFields = [];
|
||||||
|
|
||||||
const dotCommandsMap = interaction.client.dotCommands.map(e => {
|
const dotCommandsMap = interaction.client.dotCommands.map(e => {
|
||||||
return {
|
return {
|
||||||
name: e.name,
|
name: e.name,
|
||||||
@ -242,19 +234,21 @@ const functions = {
|
|||||||
usage: e.usage
|
usage: e.usage
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const e of dotCommandsMap) {
|
for (const e of dotCommandsMap) {
|
||||||
dotCommandsFields.push({
|
dotCommandsFields.push(`- .${e.name} - ${e.description}\nUsage: ${e.usage}`);
|
||||||
name: `- .${e.name}`,
|
|
||||||
value: `${e.description}\nUsage: ${e.usage}`,
|
|
||||||
inline: false,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
helpEmbed.addField('Slash Commands', strings.help.slash);
|
// Construct the Description Fields
|
||||||
helpEmbed.addFields(slashCommandsFields);
|
const descriptionFields = [
|
||||||
helpEmbed.addField('Dot Commands', strings.help.dot);
|
`${strings.help.description}\n`,
|
||||||
helpEmbed.addFields(dotCommandsFields);
|
`**Slash Commands**\n${strings.help.slash}\n`,
|
||||||
|
`${slashCommandsFields.join('\n')}\n`,
|
||||||
|
`**Dot Commands**\n${strings.help.dot}\n`,
|
||||||
|
`${dotCommandsFields.join('\n')}`
|
||||||
|
];
|
||||||
|
|
||||||
|
// Set the description
|
||||||
|
helpEmbed.setDescription(descriptionFields.join('\n'));
|
||||||
|
|
||||||
return { embeds: [
|
return { embeds: [
|
||||||
helpEmbed
|
helpEmbed
|
||||||
|
Loading…
Reference in New Issue
Block a user