The specific problem arises when defining the module export for the HelpCommand class:
**module.exports = class HelpCommand extends Command {**
The content of the help.js file, without URLs, is as follows:
const fs = require('fs');
const { Command } = require('discord.js');
const { MessageEmbed } = require('discord.js');
module.exports = class HelpCommand extends Command {
constructor() {
super('help', {
description: 'List all available commands.',
});
}
async exec(message) {
const help = new MessageEmbed()
.setColor('#F8F7D8')
.setTitle('TITLE')
.setURL('URL')
.setAuthor({
name: 'NAME',
iconURL: 'URL',
url: 'URL',
})
.setDescription('Commands for NAME')
.setThumbnail('URL')
.addFields(
{ name: '/play', value: 'Used to play the music' },
{ name: '\u200B', value: '\u200B' },
{ name: '/pause', value: 'Used to pause the music', inline: true },
{ name: '/mp3', value: 'Used to convert a youtube link to an mp3', inline: true },
{ name: '/skip', value: 'Used to skip the music', inline: true }
)
.setImage('URL')
.setTimestamp()
.setFooter({
text: 'NAME',
iconURL: 'URL',
});
await message.channel.send({ embed: help });
}
};
I attempted to make some changes to the code structure, but being new to coding, I am not entirely sure about it. My current setup uses discord.js v14.7.1 and involves converting the code into an embed format. This code functions as a slash command that sends the embed response when the user enters /help.