emoji react message
how to make it add reactions to the message?
16 Replies
⢠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.this code, and I want it to simply add reactions to the message sent to the channel
Most useful thing to send you would be
https://old.discordjs.dev/#/docs/discord.js/main/class/Message?scrollTo=react
<Message>.react(emoji)
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
I know, but where to put it?
for it to work
After you've fetched whatever message you want to add the reaction to.
It looks like you're using a button so if you want to reply to the message the button is attached to you can just put
interaction.message.react(emoji); in the block you want it to run in.
If you want the user message, you'll usually have to fetch it yourself if not available by interaction.message.
It's really dependent on what condition you want to send the reaction in.I want it to be in this place

I just don't know where to put it in the code
code
In
case "opcje": is where your sending that right?yes
You should be ok changing the line bottom .then() line to
Can compact it back to one line if you want, I multi-lined it so you can see what I did.
Just change
emoji to the emojican i use 2 times
interaction.message.react(emoji)?Yep
the emoji is only added when the button is clicked
Let me clarify...
You want to add emojis to any message send in a channel?
Are you making a suggestion channel using a modal to get the title and description? If yes to both of these then yeah this isn't gonna work on a button interaction, you have to do the samething in the model interaction after the message is sent.
I will try to do it tomorrow, and if anything, I will let know here. Hah