- Agent Zero instance (Docker or local)
- Telegram account
- Open Telegram and search for @BotFather
- Send
/newbotand follow the prompts - Choose a name (e.g., "My Agent Zero Bot")
- Choose a username (must end in
bot, e.g.,my_a0_bot) - Copy the bot token (looks like
1234567890:ABCDefGHIJklmnoPQRSTuvwxyz)
Send these commands to @BotFather:
/setprivacy— Set to "Disable" if the bot should read all group messages/setjoingroups— Set to "Enable" to allow adding to groups/setcommands— Not needed (the plugin uses!commands, not/commands)
Via Plugin Hub (Recommended):
- Open Agent Zero WebUI > Settings > Plugins
- Find "Telegram Integration" and click Install
- Dependencies install automatically
Via Script:
docker cp a0-telegram/. a0-container:/a0/usr/plugins/telegram/
docker exec a0-container bash /a0/usr/plugins/telegram/install.sh- Open Agent Zero WebUI
- Go to Settings > External Services > Telegram Integration
- Paste your bot token in the Bot Token field
- Click the Save button (outer framework Save)
- Click "Open" to view the dashboard
- Click "Test Connection" — should show green "Connected as @botname"
| What You Need | Where to Get It | Plugin Config Field |
|---|---|---|
| Bot Token | @BotFather after /newbot |
Settings > Bot Token |
| Chat IDs | Ask agent: "List my Telegram chats" | Settings > Allowed Chat IDs |
| User IDs | Forward a message to @userinfobot | Chat Bridge > User Allowlist |
Or set the environment variable:
export TELEGRAM_BOT_TOKEN="1234567890:ABCDefGHIJklmnoPQRSTuvwxyz"Ask the agent:
"List my Telegram chats"
"Read the last 20 messages from Telegram chat -1001234567890"
"Send 'Hello from Agent Zero!' to Telegram chat -1001234567890"
"Summarize the last 50 messages in Telegram chat -1001234567890"
"List administrators of Telegram group -1001234567890"
The chat bridge turns Telegram into a conversational interface for Agent Zero.
- Add the bot to a Telegram group, or start a private chat with it
- Tell the agent: "Add Telegram chat -1001234567890 to the chat bridge"
- Tell the agent: "Start the Telegram chat bridge"
- Send a message to the bot — it will respond via Agent Zero's LLM
By default, the bridge operates in restricted mode (LLM chat only, no tools). To enable full agent access:
- Enable "Allow elevated mode" in plugin settings
- Set a User Allowlist (recommended)
- Share the Auth Key securely with trusted users
- Users type
!auth <key>in Telegram to elevate - Sessions expire after the configured timeout (default: 5 minutes)
- Private chats: Send a message to the bot, then use
telegram_readwithaction: chats - Groups: Add the bot to the group, send a message, then use
telegram_readwithaction: chats - Via @userinfobot: Forward a message from the chat to @userinfobot
- Group/supergroup IDs are negative numbers (e.g.,
-1001234567890)
-
getUpdates conflict: When the chat bridge is running (polling), the
telegram_readandtelegram_summarizetools cannot usegetUpdatessimultaneously. They automatically fall back to reading from the persistent message store instead. This means recent messages may have a slight delay in appearing for tool queries while the bridge is active. -
Bot privacy in groups: By default, Telegram bots can only see messages that mention them or are replies to their messages. To read all group messages, set privacy to "Disable" via @BotFather (
/setprivacy). This must be done before adding the bot to the group. -
Long message splitting: Messages exceeding Telegram's 4096-character limit are automatically split into multiple messages. The agent handles this transparently.
-
Infection check with elevated mode: A0's safety system (infection_check) monitors agent output. In elevated mode, certain message patterns may trigger the safety check. The plugin mitigates this by sending authenticated messages as plain text through
context.communicate()— the same path as WebUI messages. -
Auto-start and preload: The chat bridge auto-start extension (
_10_telegram_chat.py) uses a deduplication flag because A0 creates multiple agent contexts during startup (~28 during preload). The bridge starts exactly once. -
Bridge sessions are in-memory: Elevated sessions, conversation history, and bridge state are stored in memory only. A
run_uirestart or bridge restart clears all sessions.
| Issue | Solution |
|---|---|
| Plugin not visible in settings | Check .toggle-1 exists: ls /a0/usr/plugins/telegram/.toggle-1 |
| Import errors on dashboard | Run initialize.py: /opt/venv-a0/bin/python /a0/usr/plugins/telegram/initialize.py |
| "No bot token configured" | Enter token in settings and click the outer Save button |
| "Unauthorized (401)" on Test | Token is invalid — regenerate via @BotFather |
| Test shows "API unavailable" | Ensure run_ui is running: supervisorctl status run_ui |
| Bridge says "Stopped" after Start | Verify python-telegram-bot is installed: /opt/venv-a0/bin/python -c "import telegram" |
| "Conflict: terminated by other getUpdates" | Only one bridge can poll per token — stop duplicate instances or other bots using the same token |
| Bot doesn't respond in group | Set privacy to Disable via @BotFather (/setprivacy) — must be done before adding bot to group |
| "An error occurred while processing your message" | Check LLM is configured in Agent Zero settings (Settings > LLM) |
| Bridge starts but no responses | Verify the chat is added to the bridge: ask agent "List Telegram bridge chats" |
| Config not saving | Use the outer framework Save button at the top of the settings panel |