Estoy intentando transferir un mensaje incrustado de un canal a otro mediante reacciones. He intentado algo como esto:
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); } });Y este es el 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: [] } }*No sé si la forma en que lo estoy haciendo es la mejor
El evento messageReactionAdd proporciona una instancia deMessageReaction como su primer argumento. Puedes desestructurar el message fuera de él.
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); } });