v3.3.2 The Help Fix #17
32
functions.js
32
functions.js
@ -210,31 +210,23 @@ const functions = {
|
||||
const helpEmbed = new Discord.MessageEmbed()
|
||||
.setColor('BLUE')
|
||||
.setAuthor({name: 'Help Page'})
|
||||
.setDescription(strings.help.description)
|
||||
.setThumbnail(strings.urls.avatar);
|
||||
|
||||
// Construct the Slash Commands help
|
||||
|
||||
let slashCommandsFields = [];
|
||||
|
||||
const slashCommandsMap = interaction.client.slashCommands.map(e => {
|
||||
return {
|
||||
name: e.data.name,
|
||||
description: e.data.description
|
||||
};
|
||||
})
|
||||
|
||||
for (const e of slashCommandsMap) {
|
||||
slashCommandsFields.push({
|
||||
name: `- /${e.name}`,
|
||||
value: e.description,
|
||||
inline: false,
|
||||
});
|
||||
slashCommandsFields.push(`- /${e.name} - ${e.description}`);
|
||||
}
|
||||
|
||||
// Construct the Dot Commands Help
|
||||
let dotCommandsFields = [];
|
||||
|
||||
const dotCommandsMap = interaction.client.dotCommands.map(e => {
|
||||
return {
|
||||
name: e.name,
|
||||
@ -242,19 +234,21 @@ const functions = {
|
||||
usage: e.usage
|
||||
};
|
||||
});
|
||||
|
||||
for (const e of dotCommandsMap) {
|
||||
dotCommandsFields.push({
|
||||
name: `- .${e.name}`,
|
||||
value: `${e.description}\nUsage: ${e.usage}`,
|
||||
inline: false,
|
||||
});
|
||||
dotCommandsFields.push(`- .${e.name} - ${e.description}\nUsage: ${e.usage}`);
|
||||
}
|
||||
|
||||
helpEmbed.addField('Slash Commands', strings.help.slash);
|
||||
helpEmbed.addFields(slashCommandsFields);
|
||||
helpEmbed.addField('Dot Commands', strings.help.dot);
|
||||
helpEmbed.addFields(dotCommandsFields);
|
||||
// Construct the Description Fields
|
||||
const descriptionFields = [
|
||||
`${strings.help.description}\n`,
|
||||
`**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: [
|
||||
helpEmbed
|
||||
|
Loading…
Reference in New Issue
Block a user