# Get images sent from Telegram

**URL:** <https://forum.rasa.com/t/get-images-sent-from-telegram/52248>\
**Category:** Rasa Open Source\
**Created:** [March 29, 2022, 3:26pm UTC](https://forum.rasa.com/t/get-images-sent-from-telegram/52248 "2022-03-29T15:26:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![throwawayaccount](https://avatars.discourse-cdn.com/v4/letter/t/f6c823/32.png) [@throwawayaccount](https://forum.rasa.com/u/throwawayaccount)\
**Post date:** [March 29, 2022, 3:26pm UTC](https://forum.rasa.com/t/get-images-sent-from-telegram/52248/1 "2022-03-29T15:26:33Z")

</div>

How can I get images sent from users on Telegram with `tracker`? It seems like `tracker.events` does not capture any response that has photos attachment?

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [March 31, 2022, 12:23am UTC](https://forum.rasa.com/t/get-images-sent-from-telegram/52248/2 "2022-03-31T00:23:52Z")

</div>

The telegram channel doesn’t handle images sent from the user. I haven’t looked at that channel in a while but you would probably want to start by looking at the code [here](https://github.com/RasaHQ/rasa/blob/eba7abcac4bda325b25fcab13a54f9676a04f562/rasa/core/channels/telegram.py#L220) and deciding how you think it should be handled in the channel.

---

<div class="post-metadata">

**Author:** ![Gehova](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Gehova](https://forum.rasa.com/u/Gehova)\
**Post date:** [March 31, 2022, 6:34pm UTC](https://forum.rasa.com/t/get-images-sent-from-telegram/52248/3 "2022-03-31T18:34:14Z")

</div>

- Write a `_is_image` function in your custom connector with the kind of images you expect receive: photo, sticker or document (you need to check the mime type for the last one). It’s all in the variable msg (`msg = update.message` in the base telegram connector).

- Call that function in the part where you validate if is a button, user message, etc.

- Write a function to download the image, see this [link](https://core.telegram.org/bots/api#getfile).

- Give a value to the `text` variable. I recommend a payload similar to the one used in buttons with an intent `image` and an entity `imagepath` with the path of the image you downloaded.

- Modify your actions, rules, stories and domain accordingly.
