#React to embed?
31 messages · Page 1 of 1 (latest)
• 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.
Here's the code:
Message#react()
Adds a reaction to the message.
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
ChatInputCommandInteraction#reply()
Creates a reply to this interaction. (more...)
it seems it's named something else
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
ephemeral messages. That would be an embed right?
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
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
I do not unfortunately
You can assign the resuting response from the reply on a variable
And use that variable to react
Resources to understand Promise:
• MDN: learn more
• Guide: learn more
• JavaScript info: learn more