Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telegram bot keyboard with emoji

I'm creating a bot in php and I need to use in keyboard some emoji.

I've no problem to use 3bit emoji (like 2b50 for medium star).

Here's a url sent to Telegram

https://api.telegram.org/bot<bot_token>/sendMessage?chat_id=<chat_id>&text=Ciao+Andrea!&reply_markup={%22keyboard%22%3A[[%22\u2b50+TEST%22%2C%22\%2FTEST+0%22]%2C[%22\%2FTest2%22%2C%22test3%22]]%2C%22resize_keyboard%22%3Atrue%2C%22one_time_keyboard%22%3Atrue}

How can I use 4bit emoji?

like image 438
Andrea Mason Avatar asked Jun 21 '16 07:06

Andrea Mason


1 Answers

I've found a workaround.

First of all, you have to search your emoji unicode. I've found useful this site http://apps.timwhitlock.info/emoji/tables/unicode .

Then, you have to search in this site https://codepoints.net your emoji unicode (ex. https://codepoints.net/U+1F680 -> Rocket),click on show more and use JavaScript, JSON and Java entry value.

Beware: If you have to use a double-code emoji (like italian flag), you have to use both unicode (for italy, U+1F1EE and U+1F1F9)

like image 75
Andrea Mason Avatar answered Oct 17 '22 17:10

Andrea Mason