packages/docs/plugin-registry/platform/telegram.md
The Telegram plugin connects Eliza agents to Telegram as a bot, handling private messages, group chats, inline queries, and media sharing.
Package: @elizaos/plugin-telegram
eliza plugins install @elizaos/plugin-telegram
/newbot and follow the prompts123456789:ABCdef...{
"connectors": {
"telegram": {
"botToken": "123456789:ABCdef..."
}
}
}
Or via environment variable:
export TELEGRAM_BOT_TOKEN=123456789:ABCdef...
| Field | Required | Description |
|---|---|---|
botToken | Yes | Telegram bot token from BotFather |
enabled | No | Set false to disable (default: true) |
dmPolicy | No | DM access policy: "pairing", "allowlist", "open", or "disabled" (default: "pairing") |
allowFrom | No | User IDs allowed to DM (required when dmPolicy is "open", must include "*") |
groupPolicy | No | Group join policy: "open", "disabled", or "allowlist" (default: "allowlist") |
webhookUrl | No | Use webhook instead of polling (requires HTTPS URL) |
webhookSecret | No | Secret token for webhook verification (required when webhookUrl is set) |
{
"connectors": {
"telegram": {
"botToken": "123456789:ABCdef...",
"dmPolicy": "pairing",
"groupPolicy": "allowlist",
"groups": {
"-1001234567890": {
"requireMention": true
}
}
}
}
}
@botname query inline in any chat/command style messagesTelegram Update (via polling or webhook)
↓
Plugin processes update type:
- message → route to AgentRuntime
- callback_query → handle button press
- inline_query → handle inline search
↓
Determines response target (chat_id)
↓
AgentRuntime processes message
↓
Response sent via Telegram Bot API
In group chats, the agent responds only when:
@botname)To have the bot respond to all messages in a group, set allowedGroups and configure the character to respond more broadly.
For production deployments, webhook mode is more reliable than polling:
{
"connectors": {
"telegram": {
"botToken": "123456789:ABCdef...",
"webhookUrl": "https://your-domain.com/webhook/telegram",
"webhookSecret": "your-random-secret"
}
}
}
The webhook endpoint must be accessible over HTTPS.
| Variable | Required | Description |
|---|---|---|
TELEGRAM_BOT_TOKEN | Yes | Telegram bot token from BotFather |
TELEGRAM_API_ROOT | No | Custom Telegram Bot API root URL |
TELEGRAM_ALLOWED_CHATS | No | Comma-separated list of allowed chat IDs |
TELEGRAM_TEST_CHAT_ID | No | Chat ID for test/dev messages |
The plugin auto-enables when connectors.telegram.botToken is set.