Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Discord.js change embed color without erasing all other content

Hello im curreently trying to fetch an Embed and then chaging its color

However this erases all other embed contents

await msg.channel.messages.fetch("msgID")
        .then(message => {
            const embedsend = new MessageEmbed()
                .setColor('#7bf542')
            message.edit({ embeds: [embedsend] })
        })
        .catch(console.error);

This is how I fetch the message and edit the embed what am I doing wrong ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Im also forced to set a description otherwise I am getting a discord API exception

>Solution :

You are recreating a new embed, use the embed of the message you fetched.

(message) => {
  const embed = message.embeds[0]
    .setColor('#7bf542');
  message.edit({ embeds:  });
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading