# Telegram Bot

Answer your Telegram bot messages without typing replies

Подключите собственного Telegram-бота для работы с ИИ-агентом

## How the agent works with Telegram Bot

The agent calls the Bot API at api.telegram.org with the token of your bot from @BotFather. The first call is getMe: it confirms the token works and shows which bot exactly is connected. From there the incoming messages of that bot, the data of their senders and the attachments go into the work: the agent pulls out the contact and the gist of the request and files the leads in a list, so nothing is lost in the flow of the chat.

A bot has two traits that shape everything else. It has a single webhook: updates go to one address only, and two handlers on the same token cannot coexist — the second one simply stops receiving messages. And in groups, with Group Privacy switched on, the bot sees only commands and replies to its own messages: the rest of the conversation is not handed to it by Telegram, and the agent treats such a group as partly visible rather than empty.

The agent writes as the bot: it answers routine questions in your brand voice, sends summaries at the hour you pick and broadcasts messages to users, then collects delivery and reply statistics. It cannot write first — Telegram lets a bot reply only to people who started the conversation themselves. A complex case is not improvised: the agent hands it to a human with a ready summary of the thread.

The token carries exactly this bot's rights: the private chats of your account and conversations without the bot are out of reach. A compromised token is revoked in @BotFather without stopping anything else — the old string stops working immediately. Telegram sending rate limits are respected by the agent itself, and if there are no messages for your request or the bot is not receiving them because of privacy, it says so directly.

## Integration scenarios

### Auto-replies to incoming messages
The agent reads the messages sent to your bot, answers routine questions in your brand voice and hands complex cases to a human with a ready summary.

### Lead intake and triage from the bot
The agent parses incoming requests, pulls out the contact and the gist of the request and files them in a list so nothing gets lost in the chat.

### Notifications and digests in chat
The agent sends sales, task or lead summaries to Telegram at the hour you pick — with no manual exports and no logging into cabinets.

### Broadcasts to bot subscribers
The agent prepares and sends a message to your bot users, then collects delivery and reply statistics.

### Files sent to the bot
The agent reads the attachments from a chat with the bot — a photo of a document, a delivery note, an export — and answers on their content without leaving the thread.

### Commands in a work group
The agent handles commands in a group and replies to messages that answer its own, flagging honestly that with privacy on it does not see the whole thread.

## How to connect

**Before you connect**

- A Telegram account to create the bot from
- Admin rights in the group the bot is added to

### Create the bot with /newbot in @BotFather
Open @BotFather and send /newbot. It asks for a name and a username: 5–32 characters, Latin letters, digits, underscores, ending in “bot”.

### Copy the token from BotFather's reply
The token arrives in one message: 110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw. Lost or leaked? Send /token for a new one.

### Turn off “Group Privacy” for groups
In @BotFather: /mybots → your bot → “Bot Settings” → “Group Privacy” → off. After the change, add the bot to the chat again.

### Free the bot from a previous integration
A bot has one active webhook, and while it is set all updates go there. If this bot already serves another service or your own script, create a separate one.

## FAQ

### How do I connect a Telegram bot?
Create a bot with @BotFather, copy the token and paste it when connecting. You do not need your own server — messages arrive through a webhook that is set up automatically.

### What data does the agent see?
Only the messages that come to your bot and the data of their senders. There is no access to private correspondence or other chats in the account — the bot is what works, not your personal Telegram.

### Can the agent write as the bot?
Yes: the agent sends replies and broadcasts from the connected bot. If you only want it to read incoming messages and notify you, that can be set up too.

### What happens after connecting?
The bot starts receiving messages right away and the agent replies according to your scenario. Telegram sending rate limits are respected automatically.

### How do I build an AI chatbot in Telegram?
An AI chatbot here takes no development: you register a bot with @BotFather, paste the token, and the agent does the answering. It handles incoming messages in your brand voice, pulls the contact and the substance of a request out of the conversation, and hands anything it should not decide alone to a person with a ready summary of the thread.

[Open Telegram Bot](https://t.me/botfather)
