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

173
Visualizações
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 Respostas
Responde à pergunta

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 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