Can't get rasa to work with telegram

I am running rasa on my server and it runs successfully with socket.io but when I try to connect it to telegram I never get a response.

I followed this: Telegram

so my credentials.yml looks like so:

telegram:
  access_token: "my_bot_father_token"
  verify: "my_verification"
  webhook_url: "http://url/webhooks/telegram/webhook"

I have tried doing just HTTP and also doing https like so: https://url:8443/webhooks/telegram/webhook but I never get anything.

I run the rasa actions server by doing: rasa run actions -vv and run rasa by doing: rasa run --enable-api --cors “*” --vv I have also tried to give it the direct ssl-certificate via the command line as detailed here: Command Line Interface but again, nothing.

I am using rasa v3 and python 3.8 in my server. My action endpoint is pointing to

action_endpoint:
 url: "http://localhost:5055/webhook"

but I’ve also tried to use it pointing at http://ip:port/webhook I am entirely at a loss as to why it’s not working…

You first have to create a Telegram bot to get credentials. Once you have them you can add these to your credentials.yml . Getting Credentials#. BKLinkGlobal Employee Login

I have done that. Which is why I wrote “my_bot_father_token_”.

That’s not it. Any other insight?

Hi @luisarmando

Could you try with NGROK once, I suspect telegram does not support URL with ports yet. Other than that your verify token should be the bot name that you have chosen while creating the bot on telegram

Here’s the link to Download NGROK

I have tried with ngrok and it worked momentarily.

That being said, if it doesn’t “support ports” I can just give it the url, can I not?

@luisarmando

So telegram does not support URL:PORT scenario that is clear now.

Yes you can give just URL but it should be a valid URL and domain, Also telegram works only on https

If the previous suggestion helped you in your issue, Could you mark it as solution so that if other face the same issue they can look at the solution

Thanks

So even when trying that, I get nothing from telegram. Not an error, message, or anything, neither does it appear in the server. This is what I have right now in endpoints.yml:

action_endpoint:
 url: "http://localhost:5055/webhook"

And then it’s pointing in credentials.yml to:

telegram:
  access_token: "my_bot_father_token"
  verify: "my_verification"
  webhook_url: "https://url/webhooks/telegram/webhook"

So, I don’t have any ports and I do have a working https. Also the bot father token was given to me by bot father and the verification is also what I used to create it.

On telegram, when I send the message I get nothing at all. On the server I get nothing it stays like:

rasa server:

2022-11-30 12:05:31 INFO     root  - Starting Rasa server on http://0.0.0.0:5005
2022-11-30 12:05:32 INFO     rasa.core.processor  - Loading model models/20221130-120513-glossy-transformation.tar.gz...
2022-11-30 12:06:48 INFO     root  - Rasa server is up and running.

and on the rasa server:

2022-11-30 12:05:21 INFO     rasa_sdk.endpoint  - Action endpoint is up and running on http://0.0.0.0:5055
2022-11-30 12:05:21 DEBUG    rasa_sdk.utils  - Using the default number of Sanic workers (1).

Am I missing something? I also double checked and port 8443 is busy but 443 is not and being used only for https so…what gives?

any other possible solution?

I can’t understand why it works when I try with ngrok but if I try on my server it doesn’t.

Hi @luisarmando

Did you try if you can hit the URL from outside? like using a chatbot first, see if you are able to make conversation from your server without the PORT.

Your server is placed on a machine I suppose, and you have purchased a domain with SSL

I’m not sure I understand your first part

I can definitely talk to the chatbot via web sockets for example, is that it?

However, the webhooks endpoint is the one that I can’t hit from the outside which makes sense to me since I don’t believe it’s meant to be hit via a browser. Unless I’m mistaken.

Also yes, my server is on a Linux server I paid for and had a valid SSL certificate as well (I have also tried giving the SSL route to the rasa run command with the --ssl-certificate and key flags)