0
votes

Note: I am using discord.js V11, I know I plan on updating it to V12 next month after I unspaghetti my spaghetti code.

So I have no idea how to grab the messageID from a message that has triggered the reaction in the bot.

The way I want it to work is as follows: A user reacts to a message, any message, with the reaction programmed within the bot. The bot then grabs the message url that the reaction was given to, and then sends a message to a client.channels.get("id").

So I tried using this code but really couldn't quite get to where I needed to be:

client.on('messageReactionAdd', async(reaction, user, message) => {
if(reaction.emoji.name === "hm") {
let ticket = client.channels.get("CHANNEL_ID");
let ticketurl = message.url

ticket.send("Test confirmed" + ticketurl);
}
});
1

1 Answers

0
votes

Figured it out!

I just needed to add this:

let ticketurl = react.message.url