Skip to content

Connecting Telegram

Bazilion can put each agent in its own Telegram forum topic inside a single supergroup: you chat with an agent by typing in its topic, and its replies mirror back there. A dedicated ⚙ bazilion topic acts as the control plane where you spawn agents and run commands.

Setup has a fair number of manual Telegram-side steps that bazilion can’t do for you (only a human can create a bot, enable forum Topics, and promote the bot to admin). This guide spells out every one of them.

  • A supergroup whose General topic is hidden, with a pinned ⚙ bazilion service topic.
  • One forum topic per agent, named after the agent, with its own icon.
  • Two-way chat: type in a topic → the agent runs a turn → its reply appears in the same topic.
  • A working bazilion daemon (see Getting started).
  • A private forum supergroup intended for you and your bot. Keep the paired owner account distinct from anonymous/channel identities.
  • A local Docker engine and compatible image on the daemon host. Telegram turns always require protected runtime readiness.
  • The Telegram app, signed in to the account that will own the supergroup.
  • About ten minutes.

  1. Open a chat with @BotFather in Telegram and send /newbot.
  2. Follow the prompts: give it a display name and a username ending in bot.
  3. BotFather replies with a bot token that looks like 1234567890:ABCdefGhIJKlmNoPQRsTUVwxyZ. Copy it somewhere safe — you’ll paste it into bazilion later.

If you ever lose the token, get a new one from @BotFather → /token.

Bazilion’s preflight checks that Privacy Mode is off; configure it explicitly.

  1. In @BotFather, send /mybots and select your bot.
  2. Open Bot Settings → Group Privacy.
  3. Set it to Turn off.

Step 3. Create a forum supergroup with Topics enabled

Section titled “Step 3. Create a forum supergroup with Topics enabled”

Bazilion needs a forum supergroup — a group with Topics turned on.

  1. Create a new group (or use an existing one you own).
  2. Open the group’s settings → Edit, and enable Topics. This converts the group into a forum supergroup.
  1. Add your bot to the supergroup.
  2. Promote it to administrator.
  3. Grant it the Manage Topics permission. This is the one permission bazilion strictly requires — it’s used to create, rename, hide, and close forum topics.

Other admin permissions are optional. (If you also want the directory message pinned, leave the bot’s pin messages permission on — but it’s best-effort and not required.)

Step 5. Get the supergroup’s numeric chat ID

Section titled “Step 5. Get the supergroup’s numeric chat ID”

Bazilion identifies the supergroup by its numeric chat ID, which looks like -1001234567890. Telegram doesn’t show this in the UI, so use a helper:

  1. Temporarily add a “get ID” bot to the group — e.g. @RawDataBot or @getidsbot. It will post the chat’s details, including an id beginning with -100.
  2. Copy that -100… number.
  3. Remove the helper bot from the group.

Part 2 — Enter your credentials in bazilion

Section titled “Part 2 — Enter your credentials in bazilion”

You can do this in the web UI or the CLI.

Go to config → Integrations → Telegram (/config/integrations/telegram). In the Credentials card:

  1. Paste your Bot token.
  2. Paste your Supergroup chat ID (the -100… number).
  3. Click save credentials.

Then click run preflight to check everything is wired up. You should see five green checks:

  • Bot identity — your bot’s @username.
  • Supergroup reachable — the group’s title.
  • Forum topics enabled — Topics are on.
  • Manage Topics — the bot is an admin with the permission.
  • Privacy Mode is OFF — the bot can read group messages.

The bot token is stored encrypted; the chat ID is stored as plain config. Saving new credentials restarts the bot automatically (this can take ~25 seconds while the previous connection drains).


Once credentials are saved, the daemon connects and activates the bot automatically. The first time it activates, it:

  1. Creates the ⚙ bazilion service topic (your control plane).
  2. Posts and pins a directory message listing your agents.
  3. Hides Telegram’s built-in General topic so the service topic is the focus.
  4. Registers the bot’s slash-command menu.

Activation creates the service topic, but does not authorize a human. Pair the owner there before trying to spawn or talk to an Agent.


Part 4 — Pair the owner and check readiness

Section titled “Part 4 — Pair the owner and check readiness”

From the authenticated CLI on the Bazilion host:

Terminal window
bazilion telegram pairing create

In the configured supergroup, open ⚙ bazilion and send /pair <code> from your intended owner account. Do not send it in a direct message to the bot, General, or an Agent topic: initial pairing only accepts the service topic. The code is short-lived, single-use, and bound to the configured bot/group.

Check the result locally:

Terminal window
bazilion telegram pairing status
bazilion telegram health
bazilion doctor

Confirm the intended owner, bot/group checks, and protected-work readiness. Health also reports membership and owner presence; the supported personal setup is one owner plus the bot. If a code expired, generate a fresh one. Use bazilion telegram pairing cancel to cancel an unused code.

Telegram turns cannot use host coding tools, browser automation, or MCP. If Docker is unavailable, pairing may succeed but Agent work will fail. Follow Docker preparation before sending work.

An agent gets a Telegram topic when you bind it. The easiest way is from the ⚙ bazilion topic itself:

In the ⚙ bazilion topic:

  • /spawn — pick a profile from the buttons, then send a name (or - to auto-name). The new agent is created and its topic is bound automatically.
  • /spawn <profile> <name> — spawn immediately. Add in <team-slug> to target a non-default Team.
  • /spawn_team — spawn a whole Team Template at once, one topic per member. Add in <team-slug> to target a named Team.
  • /talk <agent> — open or create the topic for an agent that already exists.

Once an agent is bound, just type in its topic to talk to it. While it works you’ll see a “typing…” indicator and a 👀 reaction on your message that clears when the reply lands. Accepted messages are stored individually in the durable FIFO follow-up queue, retaining their conversation and attachments. Use /queue for status and explicit pause/resume controls.

Live questions require a button response, a reply to the exact prompt, or /answer <question-id> <text>. Correlated answers bypass the follow-up queue. Attention notifications are separate, default-off notices sent to the paired group’s Bazilion service topic, with quiet hours and inspectable delivery receipts.

With BAZILION_TEAM_POLICY_ENFORCEMENT=on, Telegram uses the same live Team Policy as every other communication surface. Human ingress requires the Team’s user → Agent edge; the reply requires Agent → user. A missing edge denies, and an approval_required edge holds that one attempt in the communication approval queue. Configure and preview the Team policy before enabling enforcement so a missing edge does not look like a Telegram connectivity issue. The Telegram allowlist and Team Policy are independent, cumulative gates: allowlisting a human never bypasses the Team’s communication policy.


Initial access comes only from the pairing step above. Ordinary messages do not claim ownership, and DMs to the bot are ignored. Send commands from an identified human account in the configured supergroup; anonymous admin and channel-attributed messages are rejected.

The CLI/API retain member allowlist management for existing setups. These controls do not turn the personal owner-plus-bot profile into a supported multi-user deployment, and they do not bypass Team Policy. /allowed lists entries; an owner can manage member IDs with /allow and /deny in the service topic. The API rejects creating an owner through allow --owner: owner creation uses pairing. Do not depend on an unpaired user’s /whoami reaching the command handler; the identity gate runs first.

To change the owner, first review bazilion telegram pairing status. The explicit bazilion telegram pairing reset --yes operation clears ownership and closes ingress until you pair again. The last owner cannot be removed through ordinary member deletion.


These run in the ⚙ bazilion service topic and appear in Telegram’s slash menu:

CommandWhat it does
/spawnCreate an agent from a profile (interactive or /spawn <profile> <name>).
/spawn_teamSpawn a whole Team Template at once. Accepts [in <team>]; typed /spawn-team also works.
/talk <agent>Open or create an agent’s topic. Accepts <team>/<agent>.
/list (alias /agents)List all Agents grouped by Bazilion Team.
/teamsList Bazilion Teams with Agent counts.
/whoamiShow the already-authorized sender’s numeric Telegram user id in the service topic.
/pair <code>Claim initial ownership in the service topic with a locally generated one-use code.
/allowedList allowlisted users.
/allow <id> [label]Allow a user (owner only).
/deny <id>Remove a user (owner only).
/healthBot identity + polling state.
/helpCommand reference.

These run inside an agent’s topic (hidden from the menu, shown in /help):

CommandWhat it does
/closeClose this topic (keeps the agent binding).
/rebind <agent>Point this topic at a different agent.
/unbindClear this topic’s agent binding (topic stays as an orphan).

  • In the default Team, a topic is named after the Agent (e.g. researcher). In any other Team it is team-slug › agent-name.
  • A Team can override the format with a template using the tokens {agent.name}, {team.name}, and {team.slug} (it must include {agent.name}). Set it on the Team’s detail page (Telegram topic names card) or with bazilion team topic-format set <team> "<template>". Saving a new template renames existing topics you haven’t manually renamed in Telegram.
  • Each agent gets an icon. You can override it per agent (the topic icon field in the agent’s Telegram section); otherwise bazilion picks a default from the Agent template name and a per-Team color.

These tune Telegram behavior (set them in the daemon’s environment):

VariableDefaultEffect
BAZILION_TELEGRAM_LOOP_BUDGET20/60/60Per-agent inbound rate budget (max/window/cooldown, seconds). Over budget, new messages are paused for the cooldown with one notice.
BAZILION_TELEGRAM_AGENT_THROTTLE30/60Per-agent outbound noise budget for verbose tool-call lines. The agent’s actual reply, errors, and fatals always get through.
BAZILION_TELEGRAM_SEND_INTERVAL_MS200Minimum gap between outbound sends to one supergroup (rate-limit pacing).
BAZILION_TELEGRAM_POLLING_STALL_MS120000If no successful poll within this window, the bot self-restarts. Set to 0 to disable.

The agent doesn’t respond to plain messages. Confirm the configured group and bound Agent topic, then check pairing status, telegram health, and bazilion doctor. A failed Docker/provider preflight, policy hold, or unpaired sender can prevent a turn even when Telegram is connected. Also check the Privacy Mode setting from Step 2.

Pairing never succeeds. Send a fresh code in ⚙ bazilion inside the configured group, from a non-anonymous human account. DMs and other topics cannot complete pairing.

Browser or MCP tools are missing. This is expected in Telegram protected turns. See the capability table.

Preflight fails on “Forum topics enabled”. The group isn’t a forum. The owner must enable Topics in group settings (Step 3).

Preflight fails on “Manage Topics”. The bot isn’t an admin, or lacks the permission — redo Step 4.

Tapping a topic deep link on iOS opens the topic list, not the topic. This is an iOS Telegram limitation with no bot-side workaround — open the topic manually from the list. Desktop, web, and Android work as expected.

Someone deleted an agent’s topic. Bazilion notices on the next send, clears the binding, and stops mirroring there. Re-bind with /talk, the web bind a topic button, or bazilion telegram bind.

The bot is healthy and the user is allowed, but a message is denied or held. When Team Policy enforcement is on, inspect the Team’s Activity tab for a durable denial or /approvals (or bazilion approval list) for a pending attempt. Telegram access control does not override policy.

A media file was rejected. Bazilion downloads inbound media up to 20 MB. Images become model vision input; documents, audio, and video become saved files. Audio/video are not native multimodal input. Larger downloads are rejected.

“Supergroup chat id changed” banner. Telegram migrated your group to a new id. Click Reconnect in the web UI (or run bazilion telegram reconnect) to repoint bazilion and re-activate in the new group.

A 409 conflict in the logs. Either a webhook is set on the token or a second process is polling the same bot. Don’t run two daemons against one bot token.