I'm trying to send the custom_emoji through Telegram API using MessageEntity object.
Here is how I've tried to do it:
const message = '🚀'
ctx.sendMessage({
text: message,
entities: [{
type: 'custom_emoji',
length: message.length,
offset: 0,
custom_emoji_id: '5389102131527556772'
}]
})
p.s. I'm using Telegraf TS, but it doesn't matter since it's just a basic function
Telegram finally published more detailed doc covering this moment: https://core.telegram.org/bots/api#markdownv2-style
Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
MarkdownV2 style
![👍](tg://emoji?id=5368324170671202286)
HTML style
<tg-emoji emoji-id="5368324170671202286">👍</tg-emoji>
The documentation is a bit vague. So will explain how I get it:
p.s. Custom emoji id could be found in web.telegram.org through inspector: