0

I'm making a bot with Python and I want to send messages with emojis. How can I react a message in discord.py?

I found this method in stackoverflow but How can I react with a :tada:?

#1
message = ctx.send("text")
#2
message = channel.send("text")
#3
message = channel.fetch_message(messageid)
#add reaction to message
emoji = '\N{THUMBS UP SIGN}'
await message.add_reaction(emoji)

3 Answers3

2

Try to use the add_reaction method:

await message.add_reaction("")
one
  • 2,205
  • 1
  • 15
  • 37
1

Find unicode name for emoji you want or just use literal emoji in there - python allows for unicode characters. E.g. '\N{OPEN HANDS SIGN}' == ''

Emoji which shows up in discord when you write :tata: is ''. Its unicode name is party popper. So just use '' or '\N{PARTY POPPER}'

For Ubuntu, I found the name in Characters: screenshots of Characters application with Party Popper emoji popped up

The title bar of this small window is your unicode name. You can also directly copy the character to your clipboard by clicking the button. Underneath you have unicode number for the character.

For system-agnostic search and searching by common names (like "tada"), you can use Emojipedia. E.g. search result for "tada" on Emojipedia shows Party Popper page.

h4z3
  • 5,265
  • 1
  • 15
  • 29
  • Is there a specific name for `\N{}` syntax? All search for \N python results point to newline(\n). – Nevus Sep 29 '21 at 05:44
  • @Nevus In general, those are called escape sequences. Here's about them in python (scroll a bit down): https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals – h4z3 Oct 02 '21 at 13:29
-1

To get the unicode emoji of any discord emoji, Type the discord emoji in to the chat like this Typing the discord emoji

then type a "" character before the emoji discord emoji with backslash

Then post the message and you will get the unicode version of it, copy the unicode version and paste it like this

await message.react("")