How to set slot name and mobile from telegram chat message?

I have connected the rasa bot with telegram as per the doc. It’s working fine. Now i need to collect name and mobile number from telegram message without bot asking the customer. That means, the name and mobile number will available by default in telegram message body. How can retrieve these values from the telegram message body in my custom action?

I think you’ll have to modify the telegram channel to get this data and send to Rasa as metadata. I know you can get the username or name through the telegram python package, but i am not sure about the mobile number.

@GeovanaRamos , thanks for your replay. I have one more question, where can i find this file and how can i modify this file and in which should i save this file in my custom project folder?

You’ll probably have to override the blueprint method from the telegram channel extending the channel provided by Rasa. In your overridden method, get the username (and number if possible) from data posted by telelgram, and add to metadata. That will be your custom connector. Follow instructions here to add to your credentials. I believe that’s the way. You’ll have to try and adjust to your needs.

PS: before doing this, check the get_metadata method. Maybe it’s already doing it

Thanks, @GeovanaRamos , your solutions helped. Now am i amble to fetch username from telegram chat but not the mobile number since telegram not providing. Thanks

1 Like

Hi kabeer, can you tell me of you are fecthing the username from telegram? Thanks

Hello! Did you achieve to get the mobile number from the metadata? I need to send also some metadata at the beginning of the conversation but I don’t know how to send that info to Telegram.