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

162
Views
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 answers
Answer question

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