Not able to connect to the telegram from cloud server in digital ocean


I have created a rasa bot and I am trying to connect the bot to telegram. Bot is working fine on a local machine but when I am deploying it on Ubuntu server, telegram integration isn’t working. I am using ngnix to handle the traffic. I have opened the ports 80 , 443 , 5005 on the Ubuntu server. I have also mapped the base url of my subdomain to point to the 5005 port. Is ngrok essential for rasa bot to communicate with telegram? How to proceed further?

Hi @hemanth is this a Rasa X deployment, or Rasa Open Source only? What URL are you using as the webhook, and what errors are you getting?

It is rasa open source. is the link.

Telegram is just not able to reach the url so there is no error in the action server. But when I follow the same process of linking telegram bot in the local system with ngrok it is working fine. The link is accessible to public. How to fix to fix the issue?

This should work fine when set up properly. Can you try two things:

  • try sending a curl request to localhost:5005/webhooks/telegram/webhook from inside the machine to make sure that’s running properly
  • try sending a curl request to - do you definitely have https set up for the URL?

I was running my bot on localhost and everything was working fine and I was able to connect to Telegram. However, I was running my bot on a virtual machine (Ubuntu 16.04) and Rasa seemed to be working fine (the logs for “rasa run”, “rasa run actions”, and my other files are all returning correctly and as they did on the local server). I also set the webhook again and it was successfully set. But then, when I tried to use telegram with the bot on the VM, my bot didn’t respond to the messages from Telegram.

Would you have any advice on how I can fix this problem?

@robynbitner could you share the debug logs for your running server when you send a message to the bot?

Thanks for the response! The problem has been solved now. I think that it was the version of the VM because I tried it afterwards on Ubuntu 20.04 and it worked. Also could have been the version of Python I was using. I switched from Python 3.6 to 3.7.