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 toolkit5w 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/luna5w ago
and what is that error?
EgesWorld
EgesWorldOP5w 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/luna5w ago
thats not a djs error though and its pretty clear
EgesWorld
EgesWorldOP5w ago
fr?
treble/luna
treble/luna5w ago
you made that error you should know that, its your code
EgesWorld
EgesWorldOP5w ago
how and where?
treble/luna
treble/luna5w ago
thats up to you to figure out additionally
d.js docs
d.js docs5w 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
EgesWorldOP5w 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/luna5w ago
its your code also why are you both using builders and raw json
EgesWorld
EgesWorldOP5w 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/luna5w ago
yeah but its likely whats causing your issue
EgesWorld
EgesWorldOP5w ago
oh
treble/luna
treble/luna5w ago
figure out where you send this and start debugging there
EgesWorld
EgesWorldOP5w 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/luna5w ago
you tell us. the error isnt coming from djs, so your validation is incorrect
EgesWorld
EgesWorldOP5w ago
okay, alr
Want results from more Discord servers?
Add your server