error message and i cant solve it

there is a error that i cant fix, idk why, but can the dev community please help me 😭🙏 - included files: - Screenshot of the explorer (files) - interactionCreate.js file - commands.js file - invite.js (under this message) - if you need more files, then ping me here and i am gonna send more invite.js
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('invite')
.setDescription('Invite URL for this bot'),

async execute(interaction, client) {
try {
const botAvatarUrl = client.user.displayAvatarURL({ dynamic: true, size: 1024 });

const embed = new EmbedBuilder()
.setColor('#f87e78')
.setTitle('Text1')
.addFields(
{ name: '**Text2:**', value: 'Text3' }
)
.setThumbnail(botAvatarUrl);

await interaction.reply({ embeds: [embed], ephemeral: true });
} catch (error) {
console.error('Error executing text command:', error);
await interaction.reply({ content: 'An error occurred while executing the command.', ephemeral: true });
}
},
};
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('invite')
.setDescription('Invite URL for this bot'),

async execute(interaction, client) {
try {
const botAvatarUrl = client.user.displayAvatarURL({ dynamic: true, size: 1024 });

const embed = new EmbedBuilder()
.setColor('#f87e78')
.setTitle('Text1')
.addFields(
{ name: '**Text2:**', value: 'Text3' }
)
.setThumbnail(botAvatarUrl);

await interaction.reply({ embeds: [embed], ephemeral: true });
} catch (error) {
console.error('Error executing text command:', error);
await interaction.reply({ content: 'An error occurred while executing the command.', ephemeral: true });
}
},
};
18 Replies
d.js toolkit
d.js toolkit2mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
treble/luna
treble/luna2mo ago
and what is that error?
EgesWorld
EgesWorldOP2mo ago
Error:
Invalid command structure in invite.js. Ensure it has a name and description.
Invalid command structure in invite.js. Ensure it has a name and description.
treble/luna
treble/luna2mo ago
thats not a djs error though and its pretty clear
EgesWorld
EgesWorldOP2mo ago
fr?
treble/luna
treble/luna2mo ago
you made that error you should know that, its your code
EgesWorld
EgesWorldOP2mo ago
how and where?
treble/luna
treble/luna2mo ago
thats up to you to figure out additionally
d.js docs
d.js docs2mo ago
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
EgesWorld
EgesWorldOP2mo ago
i asked this exacte question in discord devs, and someone said come here and ask it here and now, i didnt get a second answer nice
treble/luna
treble/luna2mo ago
its your code also why are you both using builders and raw json
EgesWorld
EgesWorldOP2mo ago
bc i learned many ways to do things in visual code, and i code how im thinking, i dont think like u asked ur question :) idk why, but i am like this xd same post here: https://discord.com/channels/613425648685547541/1298692164020080650
treble/luna
treble/luna2mo ago
yeah but its likely whats causing your issue
EgesWorld
EgesWorldOP2mo ago
oh
treble/luna
treble/luna2mo ago
figure out where you send this and start debugging there
EgesWorld
EgesWorldOP2mo ago
alr @werewolvinny 👻🌈 i checked it many times, smth is wrong in invite.js, the name and description exist :/ so whats wrong then 😭🙏
treble/luna
treble/luna2mo ago
you tell us. the error isnt coming from djs, so your validation is incorrect
EgesWorld
EgesWorldOP2mo ago
okay, alr
Want results from more Discord servers?
Add your server