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 (