Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

419
Visualizações
Embed Message discord.js by module

I use module to create the command and then I want to use embed massage on there.There are my code

const { MessageEmbed } = require('discord.js')

module.exports = {
    data: new SlashCommandBuilder()
        .setName('info')
        .setDescription('Check info'),
    data: new MessageEmbed()
           .setTitle('Hello'),
    async execute(interaction) {
        await interaction.reply(`User info ${interaction.user.tag}\n Userid${interaction.user.id}\n Create Time ${interaction.user.createdAt}`);
    },
}

When I run the command,I get this.How I can fix it

0.name[BASE_TYPE_REQUIRED]: This field is required
0.type[NUMBER_TYPE_COERCE]: Value "rich" is not int.
rawError: {
    code: 50035,
    errors: { '0': [Object] },
    message: 'Invalid Form Body'
  }
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You can try this:

const { MessageEmbed } = require('discord.js')

module.exports = {
    data: new SlashCommandBuilder()
        .setName('info')
        .setDescription('Check info'),
    async execute(interaction) {
        let embed = new MessageEmbed()
        .setTitle("Title...")
        .setDescription("Description...")
        await interaction.reply({ embeds: [embed] });
    },
}
about 4 years ago · Juan Pablo Isaza Relatório

0

You are declaring the data key twice, which is probably what you don't want to do. Try this:

const { MessageEmbed } = require('discord.js')

module.exports = {
    data: new SlashCommandBuilder()
        .setName('info')
        .setDescription('Check info'),
    async execute(interaction) {
        await interaction.reply({
            embeds: [
                new MessageEmbed().setTitle("Title").setDescription("Description...")
            ]
        });
    },
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda