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

164
Visualizações
DiscordJS Send Embed in DM

I am working on a command to DM specific users an embed that is a help menu in my project. I successfully sent normal messages but I cannot get how to send embed in DM!, I read that it needed another type of embed.

module.exports = {
    name: 'costietare',
    description: "This is a help command.",
    async execute(client, message, args, Discord) {
        

   
        message.delete({timeout: 10});
        let dUser =
        message.guild.member(message.mentions.users.first()) ||
        message.guild.members.get(args[0]);
        if (!dUser) return message.channel.send("Can't find user!");
        if (!message.member.hasPermission('ADMINISTRATOR'))
        return message.reply("Insufficient Permissions!");


        let embed = new Discord.MessageEmbed()
        .setTitle('General Information')
        .setColor('YELLOW')
        .addFields(
            {name: 'Developer', value: '[m1](https://steamcommunity.com/id/catshvh)', inline:false},
            {name: '!commands', value: 'More Commands & Usage for the bot', inline:true},
            {name: 'BUY/Support', value: "[Click here to buy](https://discord.gg/4Qt3238jCy)", inline:true},
        )
        .setTimestamp()
    
 
        dUser.send(`Sunt tare, stiu`); << Here is the normal message that its perfectly fine and 
        dUser.send(`${embed}`); << this reply with **[object Object]**

        message.author.send(
            `${message.author} You have sent your message to ${dUser}`
           );    
        }

    
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Assuming you're on discord version 12 or less use this to send embeds

const embed = new Discord.MessageEmbed().setDescription('test');
message.channel.send(embed);
// for users
dUser.send(embed); // 

if you're on discord version 13

const embed = new Discord.MessageEmbed().setDescription('test');
message.channel.send({ embeds: [embed] });
//for users (dms)
dUser.send({ embeds: [embed] });

it sends the object scope aka [object Object] because you're wrapping the embed object inside of template literals ${}, just pass in the embed object as a normal parameter and it should work

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