简体   繁体   中英

Discord.js Embed reactions for another embed

I'm trying to catch reactions to make the bot send another embed

if (args[0] == "Help" && args[1] == "Images" && args[2] == 'Animals' && !args[3]) {
    msg.author.send("Its gonna be messy here on out, so, I'll just send the future embeds here as to not cluttter up your server")

    let HIAembed = new Discord.MessageEmbed()
        .setTitle('Animal')
        .setAuthor("Mo'promo")
        .setColor(0x00EEEE)
        .setDescription("`Mamamal:`-Bear, lions and tigers,.....oh my.\n\n `Bird:`-Includes storks like the ones in the movie that carried babies.\n\n`Insects:`-Creepy ants.\n\n `Reptiles&amphibians:`-Awsome! Snakes and frogs, I don't know bout you, but there my dream come true.\n\n `SeaDwellers`-There once was a starfish named tommy")

    msg.channel.send({
        embed: HIAembed
    }).then(embedMessage => {

        embedMessage.react("🐶") && embedMessage.react("🦅") && embedMessage.react("🐝") && embedMessage.react("🐍") && embedMessage.react("🦈");
    })
}

As you can see, I have the embed done and the reactions where I want them to be, I just have some trouble outputting another embed when a user clicks on an emoji.

You are going to have to use .createReactionCollector() to collect the reaction and send the embed when the reaction collector collects a specific emoji.

You can read this guide to understand reaction collectors more.

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