I need to send a message with premium emoji to a given entity using Telethon client.
Telegram account connected to client has active premium subscription.
Below is my python code:
await client.send_message(
entity="me",
message='<tg-emoji emoji-id="5301096984617166561">☝️</tg-emoji>',
parse_mode="html"
)
When I run it, instead of premium emoji with given id, regular emoji ☝️
is sent.
Why? What is the right way to send premium emoji inside message with html parse mode?
2
Answers
How to send premium emoji with Telethon client.
I am assuming your code is Python, since no mentions of code language where made at the time I read your question.
Telegram interprets the
<tg-emoji>
tag and simply renders the corresponding default emoji, ignoring theemoji-id
attribute.<tg-emoji>
tag. This willresult in a regular emoji being sent, but it allows you to get the
custom_emoji_id
.custom_emoji_id
from the sent message.custom_emoji_id
you retrieved in the previous step.From what I could find out, you need to split the code in more steps to keep the
<tg-emoji>
tag from overriding other code.(I can’t find out if the emoji id you provided is premium or not since I prefer Signal and hence won’t pay for/use Telegram)