Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python telegram telethon how to send emoji

Good day,

I missed something in telethondocumentation. All is clear with files, messages, document, but i cannot find, how to send emoji to other user. When I send emoji code like ;-) it sends it as raw message. If it is equals to send file, please help me to find list of emoji id to put into file variable. Official documentation provides functions below, it is not clear.

GetEmojiKeywordsDifferenceRequest
GetEmojiKeywordsLanguagesRequest    
GetEmojiKeywordsRequest
GetEmojiURLRequest

Please hint me with it :)

like image 312
Vova Avatar asked Jan 23 '26 20:01

Vova


1 Answers

Emoji are just strings, like any other in Python. The ";-)" replacement for "😉" in official clients is done on the client side, not the server.

You should be able to paste the emoji directly into your code, or if your editor does not support it, use a Python unicode escape:

client.send_message(chat, '😉')
client.send_message(chat, '\U0001F609')

If you prefer to use text replacements in your code, install the emoji package:

import emoji
client.send_message(chat, emoji.emojize(':wink:'))

(Please note I have not tried the emoji module myself, see their documentation for available replacements.)

like image 133
Lonami Avatar answered Jan 25 '26 20:01

Lonami



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!