最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Sending emojis with facebook messenger api and botkit - Stack Overflow

programmeradmin0浏览0评论

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 (

发布评论

评论列表(0)

  1. 暂无评论