【发布时间】:2015-10-04 12:06:42
【问题描述】:
我需要使用我的 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 机器人发送表情符号?
【问题讨论】:
标签: php telegram-bot