DEV Community

Cover image for πŸ‘‰ Emoji translations with the πŸ“ž Twilio API for πŸ’¬ WhatsApp and Node.js

πŸ‘‰ Emoji translations with the πŸ“ž Twilio API for πŸ’¬ WhatsApp and Node.js

Phil Nash on August 27, 2018

I πŸ’– emojis, so when I heard about the new Twilio API for WhatsApp I wanted to build something emojiriffic. Inspired by Monica Dinculescu’s to_emoji...
Collapse
 
rokkoo profile image
Alfonso

Good post mate! It is very useful, but a question.
If I use my personal phone number to do the tests, is it safe? I read WhatsApp sometimes prohibit accounts, to make spam.

Ty again for this post 😊

Collapse
 
philnash profile image
Phil Nash

As long as you follow the WhatsApp terms of service, particularly the parts under "Acceptable use of our services" then I'm sure you won't get banned for spam.

I've been sending messages to the WhatsApp sandbox as part of the Twilio API to test my application and had no problem.

Collapse
 
philnash profile image
Phil Nash

That's interesting! I didn't know there was a list like that of all the emoji kept up to date from the consortium. Looks like a hassle to parse!

I imagine that the manually built mapping allows more expressive keywords to be added to the JSON, rather than trying to determine them from the short description. That's definitely a trade off between ease of maintenance and keyword accuracy.

I didn't know emoninja existed though. I'm excited that it does as I'll be able to use it in my Ruby projects when I need emojis too. Thanks!

Collapse
 
adityamitra profile image
Aditya Mitra

How do you listen for incoming messages in a local node setup?

Collapse
 
philnash profile image
Phil Nash

In a local Node setup you'll need to set up a web application to receive the incoming messages. And then tunnel to that local application using something like ngrok.

Check out this tutorial that shows how to receive SMS in Node. The process for SMS and WhatsApp messages is the same.

Collapse
 
jajoosam profile image
Samarth Jajoo

Made a bot πŸ€–

Collapse
 
philnash profile image
Phil Nash

I love it! What's the Glitch project? Would love to take a look at how you did it.

Collapse
 
jajoosam profile image
Samarth Jajoo