#React to embed?

31 messages · Page 1 of 1 (latest)

tribal birch
#

I want the bot to react to an embed it has created but I can't seem to get it working. It creates the embed but doesn't emoji react to it.

cedar spireBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

tribal birch
#

Here's the code:

cedar spireBOT
tribal birch
#
    data: new SlashCommandBuilder()
    .setName ('reactionrole')
    .setDescription ('Sets up a reaction role message!'),
    async execute(interaction, message, client){

        const platformUserEmoji = ':bust_in_silhouette:';
        const creatorEmoji = ':desktop:';
 
        const embed = new EmbedBuilder()
            .setColor('#C2C2C2')
            .setTitle('Select your role!')
            .setDescription('Choose the role corresponding to your position in the Vastlight Platform.\n\n'
                + `${platformUserEmoji} for Platform User\n`
                + `${creatorEmoji} for Creator`);
                
                await interaction.reply({embeds: [embed]});
                await message.react(platformUserEmoji);
                await message.react(creatorEmoji);
    }                   
}```
#

It says: "TypeError: message.react is not a function"

#

I couldn't find the react function in the docs

cedar spireBOT
tribal birch
#

it seems it's named something else

ionic gale
#

As you see here

#

You can use the fetchReply to get the message as the resolved interaction (does not work on ephemeral messages)

#

And you can use this message that it returns to react

tribal birch
#

ephemeral messages. That would be an embed right?

ionic gale
#

Not necessarily, ephemeral messages can be of any type

#

You aren't using ephemeral

#

You dont need to worry

#

Just added as a side note

tribal birch
#

I'm sorry, i'm new to this

#

look at my code

#

how can i implement fetchReply to make the bot react to that embed?

#

I would appreciate it

ionic gale
#

You need to pass fetchReply: true to the payload

#

Assuming you know how promises work

tribal birch
#

I do not unfortunately

ionic gale
#

You can assign the resuting response from the reply on a variable

#

And use that variable to react

cedar spireBOT
tribal birch
#

You've been of great help @ionic gale

#

Much obliged

ionic gale
#

Np

#

Can you please archive this post