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 badges3 Answers
Reset to default 4I have found success by doing the following:
- Send the emoji to your bot
- Log the ining message on the server
- 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
版权声明:本文标题:javascript - Sending emojis with facebook messenger api and botkit - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1743998511a2516016.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论