#Interaction Embeds

13 messages · Page 1 of 1 (latest)

dim fjord
#

I'm doing slash commands, and wanting to do embeds in them but im getting an error:

const {
    SlashCommandBuilder
} = require('@discordjs/builders');
const { EmbedBuilder, Discord } = require('discord.js');
const config = require('../config.json');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('help')
        .setDescription('Shows a list of Entitiy\'s commands.'),
    async execute(interaction) {
        const embed = new EmbedBuilder()
            .setColor(config.colors.main)
            .setThumbnail(interaction.user.displayAvatarURL())
            .setTitle(`Entity's Help Desk`)
            .setDescription('Here is a list of all of Entity\'s commands.')
            .addField('Admin Commmands', '`ban` `-unban` `-mute` `-unmute` `-kick` `-config resetprefix`  `-config setprefix`')
            .addField('Info Commands', '`-profile` `-config`')
            .setImage('https://i.imgur.com/ZwPjsgf.png')
            .setFooter(`Requested by ${message.author.tag}`, interaction.author.displayAvatarURL({ dynamic: true }))
        await interaction.reply({
            ephemeral: true,
            embeds: [{ embed }]
        })
    }
}

Error: DiscordAPIError[50035]: Invalid Form Body
data.embeds[0].description[BASE_TYPE_REQUIRED]: This field is required

fierce starBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

spare mirage
#

Not a big deal, but try to use single quote instead of comma.
Except if you want to do markdown.
Example:

.setTitle(Entity's Help Desk) => .setTitle('Entity's Help Desk')

dim fjord
spare mirage
spare mirage
dim fjord
dim fjord
#
const {
    SlashCommandBuilder
} = require('@discordjs/builders');
const { EmbedBuilder, Discord } = require('discord.js');
const config = require('../config.json');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('help')
        .setDescription('Shows a list of Entitiy\'s commands.'),
    async execute(interaction) {
        const embed = new EmbedBuilder()
            .setColor(config.colors.main)
            // .setThumbnail(interaction.user.displayAvatarURL())
            .setTitle(`Entity's Help Desk`)
            .setDescription('Here is a list of all of Entity\'s commands.')
            .addFields(
                { name: 'Admin Commands', value: '`ban` `-unban` `-mute` `-unmute` `-kick` `-config resetprefix`  `-config setprefix`' },
                { name: 'Information Commands', value: '``-profile` `-config`' },
            )
            // .addField('Admin Commmands', '`ban` `-unban` `-mute` `-unmute` `-kick` `-config resetprefix`  `-config setprefix`')
            // .addField('Info Commands', '`-profile` `-config`')
            .setImage('https://i.imgur.com/ZwPjsgf.png')
            // .setFooter(`Requested by ${interaction.user.tag}`, interaction.author.displayAvatarURL({ dynamic: true }))
        await interaction.reply({
            // ephemeral: true,
            embeds: [{ embed }]
        })
    }
}
#

had to comment most of it out for other errors but that's fine

whole flax
#

remove the object from here. you can only send an array of embeds. not sure where the object came from

#

also, discord.js doesnt export any Discord class and SlashCommandBuilder is exported from discord.js in v14. uninstall @discordjs/builders, remove Discord and import SlashCommandBuilder from discord.js directly