Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

177
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda