admin 管理员组

文章数量: 1086019

I am writing a basic bot using botkit.js for facebook messenger. I need to be able to send a string of emojis. FB API just requires a UTF8 string. So I was able to get some emojis to work by wrapping the string in unescape. However, this doesn't work for all emojis.

unescape('I have been running for \u23F3' + uptime)

The above works fine, it will display the hour glass emoji. But if I try to use another emoji like the space invaders ship \u1F47E it does not work. All it displays is the E in the text.

Is there something I am missing here to get these to work, or is it just that I can only use a limited set of emojis?

I am writing a basic bot using botkit.js for facebook messenger. I need to be able to send a string of emojis. FB API just requires a UTF8 string. So I was able to get some emojis to work by wrapping the string in unescape. However, this doesn't work for all emojis.

unescape('I have been running for \u23F3' + uptime)

The above works fine, it will display the hour glass emoji. But if I try to use another emoji like the space invaders ship \u1F47E it does not work. All it displays is the E in the text.

Is there something I am missing here to get these to work, or is it just that I can only use a limited set of emojis?

Share Improve this question asked May 17, 2016 at 15:44 David KarasekDavid Karasek 3481 gold badge3 silver badges16 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

I have found success by doing the following:

  1. Send the emoji to your bot
  2. Log the ining message on the server
  3. Copy and paste the emoji in the logged message into the code where you want to send it from

I think this works because the ining message is in UTF8 format, so the emoji, though it will appear as an actual emoji in the log (

本文标签: javascriptSending emojis with facebook messenger api and botkitStack Overflow