Telegram Deep Linking and Rasa Intent Error

Hello everyone.

I spent 2-3 days to an issue and can’t find any solution. I am working on a chatbot that will be active on Telegram. Chatbot is directing user to a login page and after login, user should be redirected to bot’s telegram page with authorization token payload. Problem happens after redirection.

Telegram Phase:

  • According to Bots: An introduction for developers, I can redirect my user to Telegram with start intent and a payload such as https://t.me/MyBotName?start=SAMPLETOKEN.
  • If user is redirected with that link and clicks to start button at Telegram, it will send exactly that text to Rasa “/start SAMPLETOKEN”

Rasa Phase:

  • Rasa recognize that “/start SAMPLETOKEN” as a full of intent and gives ValueError: 'start SAMPLETOKEN' is not in list.

Solution Tries:

  • Rasa can detect payload if text is “/start {“token”:“SAMPLETOKEN”}”. However Telegram doesn’t support that type of deep linking url. (For example https://t.me/MyBotName?start={"token":"SAMPLETOKEN"}

  • My backend can’t handle a parallel ping with external intent because my login page is not just specific to chatbot but also other platforms.

  • I tried to change Rasa core’s telegram.py at channels folder but couldn’t figure out how to manipulate it to my purpose.

Is there anyone facing with that issue and could solve ?

I solved this issue by external intents. After login and directing to Rasa, back-end sends immediately an external intent with token payload.