# Using Agents in Telegram

### Before You Start

Make sure you:

* Have a Telegram account
* Created an agent in JetAdmin

### Setup

#### Direct Message

{% stepper %}
{% step %}
Open chat with jetadmin\_bot
{% endstep %}

{% step %}
Connect your agent using:

```
/add_agent <agent_id>
```

<figure><img src="/files/XPc7cvV3Y03gzfjVYlOS" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Once connected, you can chat with the agent directly in Telegram.
{% endhint %}
{% endstep %}
{% endstepper %}

#### Group Chat

{% stepper %}
{% step %}
Add jetadmin\_bot to your group
{% endstep %}

{% step %}
Connect your agent using:

```
/add_agent @jetadmin_bot <agent_id>
```

<figure><img src="/files/olyWFTKfsIzgy9tkkrJA" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="warning" %}

### Group Permissions

Make sure the bot has permission to:

* Read messages
* Send messages

Without these permissions, the agent may not respond correctly.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.jetadmin.io/agents/using-agents-in-external-tools/using-agents-in-telegram.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
