Hello! I made a help command with js and I have got this error, the error is below and here is the code.
const { SlashCommandBuilder } = require('@discordjs/builders');
module.exports = {
data: new SlashCommandBuilder()
.setName('help')
.setDescription('A help command.'),
async execute(interaction) {
return interaction.EmbedReply()
.setColor('#fff45e')
.setTitle('Help Command!')
.setDescription('Help Command.')
.addField('Fun', 'Utility', 'Moderation', 'Music', 'Others')
.addField(
{ name: 'Fun', value: 'Coming soon!', inline: false },
{ name: 'Utility', value: 'Coming soon!', inline: false },
{ name: 'Moderation', value: 'Coming soon!', inline: false },
{ name: 'Music', value: 'Coming soon!', inline: false },
{ name: 'Others', value: 'Coming soon!', inline: false },
)
.setTimestap()
.setThumbnail('https://i.imgur.com/vRQOSVC')
},
};
Here is the error.
PS/not giving this away/sunset lodge bot> node .
C:\not giving this away/sunset lodge bot\index.js:12
client.commands.set(command.data.name, command);
^
TypeError: Cannot read properties of undefined (reading 'name')
at Object.<anonymous> (C:\not giving this away\sunset lodge bot\index.js:12:35)
at Module._compile (node:internal/modules/cjs/loader:1099:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
Node.js v17.7.1