php - How to send Emoji with Telegram Bot API? -
i need send messages containing emoji telegram bot.
so copy/paste emoji code :nine:
example, in message text , send user, emoji didn`t work.
this sample code , function:
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']);
so, question is: how can send emoji telegram bot?
you need specify emoji's unicode value.
these returned function emoji value u'\u000026c4' snowman. although in python, can apply php.
Comments
Post a Comment