Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
Discord.js read Embd by ID

I want to make a System who read a embed by id and edit it. I want to copy the Description from the old Embed but it gives a error

Code:

            message.delete();
            if(message.author.id === "697786816379617320") {
               if(!args[1]) return message.channel.send({ content: "Keine Message ID" });
    
                else if(args[0]) {
                  const VorschlagEmbedOriginal = message.embeds[0];
                    const VorschlagAbgelehnt = new Discord.MessageEmbed(VorschlagEmbedOriginal)
                    .setTitle("» :x: - VORSCHLAG ABGELEHNT")
                    .setDescription(VorschlagEmbedOriginal.description)
                    .setThumbnail("https://i.imgur.com/kgcY5rF.png")
                    .setColor('#ff0000');
                    
                    
                    message.channel.messages.fetch({around: args[1], limit: 1})
                     .then(msg => {
                         const fetchedMsg = msg.first();
                         fetchedMsg.edit({ embeds: [VorschlagAbgelehnt] });
                    });
                }
            }
            else return;
            }`
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Assumming that this message is in the same channel that the command is being sent in this should help. You were defining the embed before it was even fetched. First you need to fetch the message then the client will have access to the message embed.

message.delete();
if (message.author.id === "697786816379617320") {
    if (!args[1]) return message.channel.send({
        content: "Keine Message ID"
    });

    if (args[0]) {
        message.channel.messages.fetch(args[1])
            .then(msg => {
                const VorschlagAbgelehnt = new MessageEmbed(msg.embeds[0])
                    .setTitle("» :x: - VORSCHLAG ABGELEHNT")
                    .setDescription(`${msg.embeds[0].description}`)
                    .setThumbnail("https://i.imgur.com/kgcY5rF.png")
                    .setColor('#ff0000');

                msg.edit({
                    embeds: [VorschlagAbgelehnt]
                });
            });
    }
} else return;
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!