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

**URL:** <https://forum.rasa.com/t/how-to-set-slot-name-and-mobile-from-telegram-chat-message/29397>\
**Category:** Rasa Open Source\
**Created:** [May 27, 2020, 4:50pm UTC](https://forum.rasa.com/t/how-to-set-slot-name-and-mobile-from-telegram-chat-message/29397 "2020-05-27T16:50:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kabeer](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kabeer/32/5310_2.png) [@kabeer](https://forum.rasa.com/u/kabeer)\
**Post date:** [May 27, 2020, 4:50pm UTC](https://forum.rasa.com/t/how-to-set-slot-name-and-mobile-from-telegram-chat-message/29397/1 "2020-05-27T16:50:03Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![GeovanaRamos](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/geovanaramos/32/9116_2.png) [@GeovanaRamos](https://forum.rasa.com/u/GeovanaRamos)\
**Post date:** [May 27, 2020, 5:27pm UTC](https://forum.rasa.com/t/how-to-set-slot-name-and-mobile-from-telegram-chat-message/29397/2 "2020-05-27T17:27:17Z")

</div>

I think you’ll have to modify the [telegram channel](https://github.com/RasaHQ/rasa/blob/master/rasa/core/channels/telegram.py) 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.

---

<div class="post-metadata">

**Author:** ![kabeer](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kabeer/32/5310_2.png) [@kabeer](https://forum.rasa.com/u/kabeer)\
**Post date:** [May 28, 2020, 4:57am UTC](https://forum.rasa.com/t/how-to-set-slot-name-and-mobile-from-telegram-chat-message/29397/3 "2020-05-28T04:57:30Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![GeovanaRamos](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/geovanaramos/32/9116_2.png) [@GeovanaRamos](https://forum.rasa.com/u/GeovanaRamos)\
**Post date:** [May 28, 2020, 11:06am UTC](https://forum.rasa.com/t/how-to-set-slot-name-and-mobile-from-telegram-chat-message/29397/4 "2020-05-28T11:06:49Z")

</div>

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](https://rasa.com/docs/rasa/user-guide/connectors/custom-connectors/) 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

---

<div class="post-metadata">

**Author:** ![kabeer](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kabeer/32/5310_2.png) [@kabeer](https://forum.rasa.com/u/kabeer)\
**Post date:** [June 1, 2020, 5:45am UTC](https://forum.rasa.com/t/how-to-set-slot-name-and-mobile-from-telegram-chat-message/29397/5 "2020-06-01T05:45:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ClaudioSpinelli](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@ClaudioSpinelli](https://forum.rasa.com/u/ClaudioSpinelli)\
**Post date:** [July 31, 2020, 5:07am UTC](https://forum.rasa.com/t/how-to-set-slot-name-and-mobile-from-telegram-chat-message/29397/8 "2020-07-31T05:07:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![elviraquesadamajorel](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/elviraquesadamajorel/32/21353_2.png) [@elviraquesadamajorel](https://forum.rasa.com/u/elviraquesadamajorel)\
**Post date:** [August 18, 2022, 1:16pm UTC](https://forum.rasa.com/t/how-to-set-slot-name-and-mobile-from-telegram-chat-message/29397/9 "2022-08-18T13:16:19Z")

</div>

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.

Thanks,

Elvira
