Search code examples
pythondiscorddiscord.py

Reacting messages with Emojis in Discord.py


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)

Solution

  • 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.