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

164
Vistas
Transfer embed messages between chats discord.js

I'm trying to transfer a embed message from a channel to another channel using reactions. I've trying somthing like this:

client.on("messageReactionAdd", (message) => {
    let analiseChannel = message.client.channels.cache.get(analiseChannelID);

    const channel = message.client.channels.cache.get(aprovadasChannelID);
    if (analiseChannel) {
        const { content, embeds } = message
        channel.send({
                content,
                embeds
            }).then(msg => {
                msg.delete({ timeout: 3000 })
            })
            .catch(console.error);
    }
});

And this is the error:

DiscordAPIError: Cannot send an empty message
    at RequestHandler.execute (R:\@Aplicações\Discord\hylex\node_modules\discord.js\src\rest\RequestHandler.js:298:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (R:\@Aplicações\Discord\hylex\node_modules\discord.js\src\rest\RequestHandler.js:50:14)
    at async TextChannel.send (R:\@Aplicações\Discord\hylex\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:172:15) {
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: undefined,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined
    },
    files: []
  }
}

*I don't know if the way I'm doing is the better one

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The messageReactionAdd event gives an instance of MessageReaction as its first argument. You can destructure the message out of it

client.on("messageReactionAdd", ({ message }) => { //notice the braces around "message"
    let analiseChannel = message.client.channels.cache.get(analiseChannelID);

    const channel = message.client.channels.cache.get(aprovadasChannelID);
    if (analiseChannel) {
        const { content, embeds } = message
        channel.send({
                content,
                embeds
            }).then(msg => {
                msg.delete({ timeout: 3000 })
            })
            .catch(console.error);
    }
});
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