小编Vlm*_*ake的帖子

如何使用Telegram Bot API发送表情符号?

我需要用我的Telegram Bot发送包含表情符号的消息.

所以我复制/粘贴表情符号代码:nine:,例如,在我的消息文本中,并将其发送给用户,但表情符号没有工作.

这是我的示例代码和函数:

function tel_send($key, $t, $c)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://api.telegram.org/bot" . $key . "/sendMessage");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "cache=" . (time() / rand(1, time() - 100)) . "&text=" . $t . "&chat_id=" . $c);
    $ss = curl_exec($ch);
    curl_close($ch);
    return $ss;
}
tel_send($key, "My number - :nine:", $val['message']['chat']['id']);
Run Code Online (Sandbox Code Playgroud)

所以,我的问题是:我如何通过Telegram bot发送表情符号?

php telegram-bot

26
推荐指数
5
解决办法
5万
查看次数

标签 统计

php ×1

telegram-bot ×1