> For the complete documentation index, see [llms.txt](https://docs.jugalbandi.opennyai.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jugalbandi.opennyai.org/building-with-jugalbandi/technical-guide/references/telegram.md).

# Telegram

## Steps to follow

a. **Create a Telegram Bot**:

* Use the *BotFather* chatbot on Telegram to create your bot
* Acquire the token provided by *BotFather*. This token will be used to set up the webhook

b. **Create a JB Manager Bot**:

* Set up a bot as described in the quickstart documentation
* Select type as `telegram` and appropriate details while creating the channel

c. **Set-up the Webhook**:

* Set the webhook by sending a POST request to `https://api.telegram.org/bot<token>/setWebhook` with the URL of the endpoint as the body under the `url` key. The format should be: `<tunnel_url>/v2/callback/telegram/<app_id>`.
* Example using `curl`:

  ```bash
  curl -X POST "https://api.telegram.org/bot<token>/setWebhook" -d "url=<tunnel_url>/v2/callback/telegram/<app_id>"
  ```

## Note:

* **BotFather**: This is an official Telegram bot that helps you create and manage your Telegram bots. You can find it by searching for "BotFather" in the Telegram app
* **Webhook URL**: The `<tunnel_url>` should be the URL where your API is hosted. Ensure it is accessible from the internet for Telegram to send updates to your bot

  By following these steps, you can set up, integrate and test your Telegram-based JB Manager bot.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.jugalbandi.opennyai.org/building-with-jugalbandi/technical-guide/references/telegram.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
