Skip to content
Advertisement

How to send custom emoji by Telegram bot?

I want to send premium emojis by Telegram bot (I have a premium account and created a bot with it), but when I try to send it (I send emojis to the premium account), unfortunately, the emoji is sent normally.

my code:

<?php

$entities = [
    'type' => 'custom_emoji',
    'offset' => 4,
    'length' => 2,
    'custom_emoji_id' => '5877565553761062314'
];

$url = "https://api.telegram.org/BotToken";
$url .= "/sendMessage?chat_id=UserChatId";
$url .= "&text=Hi 💻";
$url .= "&parse_mode=html";
$url .= "&entities=" . json_encode($entities);
echo $url;
file_get_contents($url);

Message should be like this: Message with Telegram custom emoji

Advertisement

Answer

This feature will be activated in the future.

https://telegram.org/faq_premium#q-can-i-buy-a-premium-subscription-for-my-bots

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement