> For the complete documentation index, see [llms.txt](https://4bcplaybook.clearglobal.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://4bcplaybook.clearglobal.org/7-development-and-deployment-guidelines/7.3-chatbots/7.3.6-channel-integrations/7.3.6.3-telegram.md).

# 7.3.6.3 Telegram

You first have to create a Telegram bot to get credentials. Once you have them you can add these to your credentials.yml.

**How to get the Telegram credentials**

You need to set up a Telegram bot.

1. To create the bot, go to [Bot Father](https://web.telegram.org/#/im?p=@BotFather), enter `/newbot`, and follow the instructions. The URL that Telegram should send messages to will look like `http://<host>:<port>/webhooks/telegram/webhook`, replacing the host and port with the appropriate values from your running Rasa X or Rasa Open Source server.
2. At the end you should get your access\_token and the username you set will be your verify.
3. If you want to use your bot in a group setting, it's advisable to turn on group privacy mode by entering `/setprivacy`. Then the bot will only listen when a user's message starts with /bot.

For more information, check out the [Telegram HTTP API](https://core.telegram.org/bots/api).

### Running on Telegram

Add the Telegram credentials to your credentials.yml:

```
telegram:
access_token: "<token>"
verify: "your_bot"
webhook_url: "https://your_url.com/webhooks/telegram/webhook"
```

Restart your Rasa X or Rasa Open Source server to make the new channel endpoint available for Telegram to send messages to.

Also check:[ Setup HTTPS on localhost for testing the API/Channels](https://translatorswb.slab.com/posts/setup-https-on-localhost-for-testing-the-api-channels-uevn4qbd)

Supported Response Attachments

In addition to standard text: responses, this channel also supports the following components from the [Telegram API](https://core.telegram.org/bots/api/#message):

* button arguments:
  * button\_type: inline | vertical | reply
* custom arguments:
  * photo
  * audio
  * document
  * sticker
  * video
  * video\_note
  * animation
  * voice
  * media
  * latitude, longitude (location)
  * latitude, longitude, title, address (venue)
  * phone\_number
  * game\_short\_name
  * action

Examples:

```
utter_ask_transfer_form_confirm:
- buttons:
- payload: /affirm
title: Yes
- payload: /deny
title: No, cancel the transaction
button_type: vertical
text: Would you like to transfer {currency}{amount_of_money} to {PERSON}?
image: "https://i.imgur.com/nGF1K8f.jpg"
Copy
utter_giraffe_sticker:
- text: Here's my giraffe sticker!
custom:
sticker: "https://github.com/TelegramBots/book/raw/master/src/docs/sticker-fred.webp"
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://4bcplaybook.clearglobal.org/7-development-and-deployment-guidelines/7.3-chatbots/7.3.6-channel-integrations/7.3.6.3-telegram.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
