# How to use Rasa telegram custom buttons?

**URL:** <https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984>\
**Category:** Rasa Open Source\
**Created:** [November 4, 2021, 9:42am UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984 "2021-11-04T09:42:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [November 4, 2021, 9:42am UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/1 "2021-11-04T09:42:12Z")

</div>

Hello, i am developping a bot and i want to link it with telegram. I want to use custom button in order to send location(venue) , i saw in the [documentation](https://rasa.com/docs/rasa/connectors/telegram) that its possible with the custom arguments but there is no more information about how to use it or examples. It will be great if someone could help me with an example !

---

<div class="post-metadata">

**Author:** ![InnoOmnia](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/innoomnia/32/17290_2.png) [@InnoOmnia](https://forum.rasa.com/u/InnoOmnia)\
**Post date:** [November 4, 2021, 2:11pm UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/3 "2021-11-04T14:11:05Z")

</div>

I don’t have example but where you get stuck? Do you get anything to work?

---

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [November 4, 2021, 2:33pm UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/4 "2021-11-04T14:33:48Z")

</div>

not yet

i want a button to send location in the documentation they give this for example

```auto
utter_giraffe_sticker:
 - text: Here's my giraffe sticker!
   custom:
     sticker: "https://github.com/TelegramBots/book/raw/master/src/docs/sticker-fred.webp"

```

but nothing for location

---

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [November 4, 2021, 4:06pm UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/5 "2021-11-04T16:06:41Z")

</div>

@Juste anything 😭 ?

---

<div class="post-metadata">

**Author:** ![InnoOmnia](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/innoomnia/32/17290_2.png) [@InnoOmnia](https://forum.rasa.com/u/InnoOmnia)\
**Post date:** [November 5, 2021, 9:33am UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/6 "2021-11-05T09:33:57Z")

</div>

Telegram API defines like this

> [Telegram Bot API](https://core.telegram.org/bots/api/#location)

```auto
Location
This object represents a point on the map.

Field	Type	Description
longitude	Float	Longitude as defined by sender
latitude	Float	Latitude as defined by sender
horizontal_accuracy	Float number	Optional. The radius of uncertainty for the location, measured in meters; 0-1500
live_period	Integer	Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.
heading	Integer	Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
proximity_alert_radius	Integer	Optional. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.

```

```auto
ChatLocation
Represents a location to which a chat is connected.

Field	Type	Description
location	Location	The location to which the supergroup is connected. Can't be a live location.
address	String	Location address; 1-64 characters, as defined by the chat owner

```

And found this, any help?

> [Getting Started With RASA-ChatBot And Telegram | by Manaan Ansari | Medium](https://manaanansari.medium.com/getting-started-with-rasa-chatbot-and-telegram-part-1-d289977e24ac)

---

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [November 5, 2021, 9:41am UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/7 "2021-11-05T09:41:58Z")

</div>

unfortunatly no I want to send a button for which when the user presses it, sends me its location. I thought that the custom argument in the [rasa documentation](https://rasa.com/docs/rasa/connectors/telegram) allowed to do it, am I right?

---

<div class="post-metadata">

**Author:** ![InnoOmnia](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/innoomnia/32/17290_2.png) [@InnoOmnia](https://forum.rasa.com/u/InnoOmnia)\
**Post date:** [November 5, 2021, 10:51am UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/8 "2021-11-05T10:51:40Z")

</div>

Ok, see this

> [Inline Bots](https://core.telegram.org/bots/inline)

and this

> [Telegram Bot API](https://core.telegram.org/bots/api/#inline-mode)

and this

> [Telegram Bot API](https://core.telegram.org/bots/api/#inlinequeryresultlocation)

---

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [November 5, 2021, 10:58am UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/9 "2021-11-05T10:58:56Z")

</div>

by chance do you know how to implement it with rasa ?

---

<div class="post-metadata">

**Author:** ![InnoOmnia](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/innoomnia/32/17290_2.png) [@InnoOmnia](https://forum.rasa.com/u/InnoOmnia)\
**Post date:** [November 5, 2021, 11:08am UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/10 "2021-11-05T11:08:58Z")

</div>

Not directly, it looks like you need a custom actions for this. I can try later, also I have never tried Rasa telegram connection so will try it too

---

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [November 5, 2021, 11:12am UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/11 "2021-11-05T11:12:26Z")

</div>

ok let me know, i will search on my side too rasa integration with telegram is very easy but , having some buttons is complicated more for custom

---

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [November 11, 2021, 9:09am UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/12 "2021-11-11T09:09:48Z")

</div>

hello, i am still stuck could anyone help me ? @nik202 anything ?

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [November 11, 2021, 12:26pm UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/13 "2021-11-11T12:26:04Z")

</div>

Hi and sorry for later reply @M_R_LY. Unfortunately I never worked on Telegram, else definitely you get my solution, sorry on this MJ.

---

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [November 11, 2021, 12:44pm UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/14 "2021-11-11T12:44:19Z")

</div>

do you know something about the documentation and how to use it here [Telegram](https://rasa.com/docs/rasa/connectors/telegram#supported-response-attachments)

or someone ?

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [November 11, 2021, 12:47pm UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/15 "2021-11-11T12:47:40Z")

</div>

@M_R_LY confirm me, are you able to integrate rasa with telegram?

---

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [November 11, 2021, 12:48pm UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/16 "2021-11-11T12:48:49Z")

</div>

yes but i have problem with the buttons i used the exemples in the documentation but i dont have engough for the location custum button

---

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [November 18, 2021, 3:56pm UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/19 "2021-11-18T15:56:37Z")

</div>

Hello, i am still blocked if anyone can help please @ChrisRahme anything ?

---

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [November 19, 2021, 9:51am UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/20 "2021-11-19T09:51:14Z")

</div>

I want a button that when the user click on it it send the user’s location i saw that its possible to do it with some keyboardbutton but i am having trouble with it

---

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [December 9, 2021, 12:07pm UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/21 "2021-12-09T12:07:23Z")

</div>

Hi, still struggling at it i saw this link [Getting location - #7 by JiteshGaikwad](http://forum.rasa.com/t/getting-location/22065/7) by @JiteshGaikwad i am looking for the same thing but for telegram connector.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [December 9, 2021, 5:34pm UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/22 "2021-12-09T17:34:07Z")

</div>

@M_R_LY Hello, sorry for getting back to you late. If there is any resources I encountered I will try share with you about your use case i.e Telegram. Currently, I personally not implemented this use case.

---

<div class="post-metadata">

**Author:** ![M\_R\_LY](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m_r_ly/32/11754_2.png) [@M\_R\_LY](https://forum.rasa.com/u/M_R_LY)\
**Post date:** [December 10, 2021, 10:47am UTC](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984/23 "2021-12-10T10:47:17Z")

</div>

hello, no problem, am stilll trying to figure it out i have been able to send a button but throught the api now i want to do it using the dispatcher here is the request code that i want to transform into json

```auto
r = requests.post(
        # "https://api.telegram.org/bot14xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5JzAs/", 
        # json={'method':'sendMessage', 'chat_id':"xxxxxxx", 'text':'Hello',
        # 'reply_markup':{'keyboard':[[{ "text": "Location", "request_location": True }]], "one_time_keyboard" : True}})

```

how to transfom the json part in order to send it via the dispatcher : `dispatcher.utter_message(json_message=jsonaa)`

[Next page](https://forum.rasa.com/t/how-to-use-rasa-telegram-custom-buttons/48984.md?page=2)
