Telegram AI agent connector: talk to your agent from Telegram

Give your flespi AI agent a Telegram bot identity and talk to it right from Telegram

Essentials

The Telegram connector gives your flespi AI agent a Telegram bot identity. Talk to the agent right from Telegram — alone in a private chat or together with your team in groups — and receive its approval requests as Approve/Reject prompts in the private chat.

Setup

Create a bot with @BotFather using the /newbot command and paste the issued bot token into the connector configuration — that is the only field. The bot identity, name, and picture are yours to manage in BotFather.

The bot must be dedicated to this agent alone: Telegram delivers a bot's incoming updates to a single consumer, so a bot shared with another system stops receiving messages for the agent.

Linking chats

Chats are not configured — they link to the agent with a one-time code. Ask the agent to connect a chat, and it hands you the link:

  • private chat: open https://t.me/{bot}?start={code} — one tap links it;
  • group: open https://t.me/{bot}?startgroup={code} and pick the group, or send /link {code} in a group the bot is already in.

Codes are single-use, expire in one hour, and a fresh code replaces each used one. Treat a code like a key: whoever uses it links their chat. The first person to link a chat becomes the agent's recorded owner in Telegram.

Up to 20 chats can be linked. To unlink, send /unlink in the chat (allowed to the person who linked it or the owner), or simply ask the agent — the bot says goodbye and leaves the group. A chat that is not linked gets no access: private chats receive a short hint about the link code, groups are ignored entirely.

Working with the agent

The agent answers in the linked chat as the bot, with a typing indicator while it works. It formats replies with Telegram markup, sends photos, documents, and location pins, and can offer quick-reply buttons for simple decisions — one tap answers for the whole chat.

Incoming photos and documents up to 16 MB reach the agent; voice messages, video, and stickers do not — the agent will ask for text, a photo, or a document instead.

How much of a group the bot sees is controlled by Telegram: with the default BotFather privacy mode it receives only mentions, replies to its messages, and commands. Turn privacy mode off or make the bot a group admin to let the agent follow the whole conversation.

Approvals

The owner's private chat doubles as the approval surface: every operation awaiting a decision arrives as a message with Approve and Reject buttons. Only the owner can decide, and a request resolved anywhere — in Telegram or in the flespi panel — disappears everywhere.

Sending Telegram messages needs no approval rule of its own: the agent can only write to chats you linked, so the authorization happened when you linked them.

Good to know

  • The agent sees no chat history: only messages arriving while the chat is linked reach it.
  • Group messages are visible to everyone present, so the agent never posts credentials or sensitive account data there and routes account-changing requests from group members through the approval flow.
  • Incoming messages are treated as untrusted: a message instructing the agent to change its configuration or reveal secrets is reported to you instead of obeyed.
  • Bots can talk to each other in shared groups when their BotFather settings allow it — enable Bot-to-Bot Communication Mode (with group admin and privacy mode off) to open a full agent-to-agent exchange.
  • Swapping the token to a different bot resets all links and the recorded owner; everyone re-links from scratch. A regenerated token for the same bot keeps the links.

See also
Give your flespi AI agent access to a Wialon Hosting account to operate it on your behalf