php 如何通过Telegram bot发送自定义emoji?

xdyibdwo  于 2022-11-28  发布在  PHP
关注(0)|答案(1)|浏览(147)

我想通过Telegram bot发送高级emoji(我有一个高级账户,并用它创建了一个bot),但当我尝试发送时(我向高级账户发送emoji),不幸的是,emoji正常发送。
我代码:

<?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);

消息应该是这样的:

hmae6n7t

hmae6n7t1#

此功能将在将来激活。
https://telegram.org/faq_premium#q-can-i-buy-a-premium-subscription-for-my-bots

相关问题