> ## Documentation Index
> Fetch the complete documentation index at: https://meepa.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Telegram

> Connect MeepaGateway to Telegram

Connects to the [Telegram Bot API](https://core.telegram.org/bots/api) via long polling or webhook.

## Prerequisites

* A bot token from [@BotFather](https://t.me/botfather)

## Configuration

In `~/.meepagateway/agents/<id>/agent.yaml`:

<Tabs>
  <Tab title="Long Polling (default)">
    ```yaml theme={null}
    connectors:
      - type: telegram
        bot_token: "123456:ABC-DEF..."
        poll_interval: "1s"
    ```
  </Tab>

  <Tab title="Webhook Mode">
    ```yaml theme={null}
    connectors:
      - type: telegram
        bot_token: "123456:ABC-DEF..."
        webhook_url: "https://your-domain.com/telegram/webhook"
        webhook_port: 8443
    ```
  </Tab>
</Tabs>

<ParamField path="bot_token" type="string" required>
  Telegram bot token from @BotFather.
</ParamField>

<ParamField path="poll_interval" type="duration" default="1s">
  Polling frequency for long-polling mode. Supports `s`, `m`, `h`.
</ParamField>

<ParamField path="webhook_url" type="string">
  Public HTTPS URL for webhook delivery. If set, polling is disabled and a local HTTP listener starts on `webhook_port`.
</ParamField>

<ParamField path="webhook_port" type="integer">
  Local port for the webhook listener.

  **Example:** `8443`
</ParamField>
