我需要使用 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']);
所以,我的问题是:如何通过 Telegram 机器人发送表情符号?