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

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

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