How to send custom emoji by Telegram bot?
Asked Answered
J

2

5

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

Jus answered 13/11, 2022 at 8:0 Comment(4)
We encountered the same problem. We think that its now available rn because you can not buy premium for bots – Dollie
Just published the answer in #74438442 – Penrose
@Penrose The emojis you used are normal and are easily available in the free version of Telegram, but I mean premium Telegram emojis that bots are currently unable to send. – Jus
@MohammadZarchi yes, I understand what premium or custom emojis are. As I mentioned in the thread above, custom emojis can be used by bots that purchased additional usernames on Fragment. Check the doc core.telegram.org/bots/api#markdownv2-style – Penrose
J
7

This feature will be activated in the future.

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

Jus answered 23/11, 2022 at 12:11 Comment(2)
That's not what the linked FAQ says. It simply says that it's not currently supported and to follow the blog in case it does get supported in the feature. I'm not sure where you're getting the "will be activated in the future" from. – Eiger
close/accept this awnser – Silicone
B
0

Due to the instruction, I bought a collectible. Then, I tried to assign a collectible name to my Telegram bot and received a notification:

You can now upgrade collectible usernames to assign them to Telegram bots. To upgrade, assign the username to a bot and pay a one-time fee of 1,000 per username. Usernames will remain upgraded even if they change owners.

It is a bit expensive for me.

Balaton answered 9/6 at 10:45 Comment(0)

© 2022 - 2024 β€” McMap. All rights reserved.