简体   繁体   中英

How to check if the original message sender reacts discord.js

My current code is

            message.channel.send(dungeonEmbed).then(sentEmbed => {
                sentEmbed.react("⚔️")
            })

this sends the embed, and reacts, but I need to figure out a way to check if the original message sender reacts, and to then replace an embed with another

I'm not sure what you want.
Let's guess you want if the author reacts on his own message

client.on("messageReactionAdd", (reaction, user) => {
    if(reaction.message.id == "The message ID" && user.id == reaction.message.author.id){
        //The author and the original message has reacted
        if(reaction.emoji.name == "🐱"){
            //The author has reacted the specified emoji
        }
    }else{
        //Just in case
    }
})

Please also check this one too Discord js check reaction user role

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM