Setup
Create bot with BotFather
- Message @BotFather on Telegram
- Use
/newbotand follow prompts - Copy the bot token
Bot Commands
Provider Management
/provider
Show interactive provider selection with inline buttons:
- Claude (🧠)
- Ollama (💻 Local)
- OpenRouter (🌐)
- OpenAI (🤖)
- Google Gemini (🔍)
- Groq (⚡)
/model
Display current model information:
Thinking and Reasoning
/think (aliases: /thinking, /t)
Set thinking level with inline buttons:
off, minimal, low, medium, high, xhigh
Available levels depend on your active model.
xhigh requires specific models like GPT-5.2 or Claude Opus./reasoning
Control reasoning visibility:
- off - Hide reasoning blocks
- on - Show reasoning before final answer
- stream - Send incremental status updates
Execution Controls
/exec_mode
Control shell command safety:
- deny - Exec disabled (safest)
- allowlist - Only allowed binaries run
- full - Any command allowed (use with caution)
/allow <binary>
Add a binary to the execution allowlist:
- Only alphanumeric names with
._+- - Shell launchers blocked (
bash,sh,powershell, etc.)
/allowlist
Show current allowlist configuration:
Approval System
/approvals
List pending execution approvals with inline action buttons.
When Asta needs to run a command in allowlist mode, you’ll receive:
After approval, Asta automatically resumes your request with the command result.
Subagent Management
/subagents
Manage background subagents:
Status Commands
/status
Show system health:
Audio Notes
Send voice messages or audio files for transcription and formatting:Record or attach
- Voice message (up to 20 MB)
- Audio file (.mp3, .m4a, .wav, .ogg, etc.)
- Direct download link (up to 50 MB)
Add caption (optional)
Caption specifies formatting:
meeting notes- Save as retrievable meetingaction items- Extract todosconversation summary- Summarize dialogue
Audio from URL
Workaround for files larger than Telegram’s 20 MB limit:Meeting notes with “meeting” in the instruction are automatically saved and can be retrieved later with queries like “What did we discuss in the last meeting?”
Message Processing
All text messages are processed through the samehandle_message flow as the web interface:
- Sequential per-chat - Lock prevents race conditions
- Context building - Pulls from calendar, files, integrations
- AI response - Uses your default provider
- Markdown formatting - Converts to Telegram HTML
- Media extraction - Sends images/GIFs as native Telegram media
Special Behaviors
Short agreements - When Asta replies with short yes/no answers, it reacts to your message with 👍 instead (cooldown: 15 minutes). GIF support - Markdown images with Giphy or.gif URLs are sent as animations.
Data URLs - Base64 data image URLs are decoded and sent as photos.
Implementation Reference
Seebackend/app/channels/telegram_bot.py:
- Lines 343-463: Main message handler
- Lines 466-539: Voice/audio handler
- Lines 614-668: Provider selection
- Lines 670-688: Model info
- Lines 1119-1161: Exec mode controls
- Lines 838-886: Allow command
- Lines 993-1019: Approvals list
- Lines 1021-1090: Approval callback handler
- Lines 1223-1278: Thinking controls
- Lines 1317-1355: Reasoning controls
Rate Limiting
The bot usesAIORateLimiter from python-telegram-bot to prevent API overload. Automatic retry with exponential backoff.