Interface Parameters
Pass one ofagent, team, or workflow to the Telegram constructor.
Default commands:
Endpoints
POST {prefix}/webhook
Receives Telegram updates (messages, edited messages, media).
GET {prefix}/status
Health check. Returns {"status": "available"}.
Security
Webhook requests must include theX-Telegram-Bot-Api-Secret-Token header, validated against TELEGRAM_WEBHOOK_SECRET_TOKEN using constant-time comparison.
Development mode: Set APP_ENV=development to bypass validation (logs a warning).
Message Processing
Session Scope
Session IDs are scoped to prevent cross-chat context leakage:Streaming Events
Whenstreaming=True, the interface dispatches real-time status updates:
Workflow events: Step names, loop iterations, and parallel execution status shown with indentation.
Rate limiting: Respects Telegram’s 429
retry_after field. Pauses edits during rate-limit periods.
Text Formatting
Markdown is converted to Telegram HTML:
Messages exceeding 4096 characters are automatically split.
Media Support
Input (from users):
Max download size: 20 MB.
Output (from agent): Images, audio, videos, and files sent via respective Telegram API methods.
Environment Variables
Developer Resources
Telegram Guide
Setup, code examples, and streaming behavior.
TelegramTools
Toolkit for sending messages and media from agents.