# Connect Telegram

## Get the right token

Open [BotFather](https://t.me/BotFather). Create a bot with `/newbot`, or choose one you own. Open the bot's **Serverless** settings and enable the feature. Then open **CLI Access → Access token**.

The Serverless CLI token starts with `app`, such as `app1234:secret`. It is separate from the normal Bot API token. Do not paste it into AI chat, source files, screenshots, or support messages.

## Verify the connection

In TeeAI, choose **Connect Telegram**, enter the bot's username and the Serverless CLI token, and submit. The platform makes a real read-only cloud request. A network failure is not treated as a verified connection.

Credentials are encrypted at rest and only supplied to the publisher for the selected bot. The username is supplied by you; check it matches the bot selected in BotFather.

If cloud code already exists, TeeAI requires a complete import before editing or publishing. A workspace cannot be rebound to a different Telegram app after connection; create another workspace instead.

## Rotate a token

Generate a replacement in BotFather and reopen Connection in TeeAI. Wait for active tasks to finish first. Never revoke the old token while a publish is in progress.

See [Telegram's official Serverless documentation](https://core.telegram.org/bots/serverless) for the current BotFather screens and platform availability.
