Telegram Spanish Assistant 1.0


Wednesday, July 22, 2020
Posted by Tushar Nitave, Dept. of Computer Science, Illinois Tech, Chicago


In this post I will be talking about developing a Telegram bot which will translate your English sentences into Spanish (we can do this for any language but I will keep this post only to this specific language) and vice-versa. We will be using IBM Cloud services like Node-Red, IBM Language Translator and Telegram app.

1. Setup Telegram Bot

  1. Install Telegram app on your laptop or mobile device.
  2. After installing Telegram app search for "BotFather" and send a message /newbot and follow the instructions:
    • Set a name.
    • Set a username.
    • Save the access token for future use.

2. Setup Node-RED app

  1. Create an IBM Cloud account here https://cloud.ibm.com
  2. Go to your IBM Cloud account and then click Catalog.
  3. Search Node-RED App and select it.
  4. Click create and provide App name (can be anything) and click create again.
  5. Wait for a minute until the application is provisioned and then click Visit App URL.
  6. Enter username and password . This will create a new username and password for your Node-RED app. Click next and then click Go to your Node-RED flow editor.
  7. Click the hamburger icon from upper right menu and then select Manage palette.
  8. From the Manage palette menu, click the install tab and then search for Telegram.
  9. Install the node-red-contrib-telegrambot.
  10. Again select the hamburger icon from upper right menu and select import.
  11. Copy the code from here and paste it into the Node-RED clipboard.
  12. Go to Catalog from the panel located on left side and search language translator. Select it and click create.
  13. Click hamburger icon from upper left corner and select resource list. Go to services and select language translator service. Your API key and URL (serivce endpoint) will be visible which we will use in the next step.
  14. Go to your Node-Red flow editor and double click on language identify node and provide API key and service endpoint obtained from previous step and then click done.
  15. Double click on Telegram receiver node. Click the pencil icon. Provide the bot name and Token created while setting up Telegram bot.
  16. Follow the above step for Telegram sender node.
  17. Click deploy. After few seconds you will see that the node has been successfully deployed.
  18. Finally go to your Telegram app and search for your bot. Send /start message. The response is show in the picture at the start of this post here.


For further enhancements we can add speech-to-text and text-to-speech services. Also, we can add multiple languages for translation. Feel free to connect and share your views.