Telegram Bot Setup
Asta includes a full-featured Telegram bot that shares context with the desktop app and web panel. Send messages, voice notes, and manage exec command approvals—all from Telegram.Features
- Unified context — Same chat history as desktop/web
- Voice transcription — Send voice messages or audio files for meeting notes
- Exec approvals — Approve/deny shell commands with inline buttons
- Provider switching — Change AI provider and model via
/providercommand - Audio URL support — Paste direct audio links (up to 50 MB) for long recordings
Create a bot with BotFather
- Open Telegram and search for @BotFather
- Start a chat and send
/newbot - Follow prompts to choose a name and username
- Save the token BotFather provides (looks like
1234567890:ABCdefGHIjklMNOpqrsTUVwxyz)
Keep your bot token secret. Anyone with the token can control your bot.
Configure Asta with the bot token
Option 1: Web SettingsRestart Asta after saving.
- Open Asta’s web panel at
http://localhost:8000 - Go to Settings → Telegram
- Paste your bot token
- Click Save
.env in ~/workspace/source/backend/:Restrict access (recommended)
By default, anyone can message your bot. To restrict access:Find your Telegram user ID:Comma-separated list of numeric user IDs.
- Message your bot:
/start - Check Asta logs for your user ID (9-10 digits)
Bot Commands
All commands work in any chat with your bot:| Command | Description |
|---|---|
/start | Show welcome message and command list |
/provider | Switch AI provider (Claude, Google, OpenAI, Groq, OpenRouter, Ollama) |
/model | Show current provider and model |
/think | Set thinking level (off, minimal, low, medium, high, xhigh) |
/reasoning | Toggle reasoning visibility (off, on, stream) |
/exec_mode | Change exec security mode (deny, allowlist, full) |
/allow <binary> | Add a binary to exec allowlist (e.g., /allow rg) |
/allowlist | Show current exec allowlist and mode |
/approvals | List pending exec approvals |
Example: Switching Providers
Example: Allowing a Command
rg (ripgrep) to the exec allowlist. Asta can now run rg commands when exec_mode is allowlist.
Voice Messages & Audio Files
Send voice messages or audio files to Asta for automatic transcription and formatting:- Record a voice message in Telegram (hold the mic button)
- Or attach an audio file (up to 20 MB via Telegram, 50 MB via URL)
- Optionally add a caption like
meeting notesoraction items - Asta transcribes and formats the content
Audio URL Workaround (for files >20 MB)
Telegram limits file downloads to 20 MB. For longer recordings:- Upload to a file host (Google Drive, Dropbox, etc.)
- Get a direct download link (must end in
.mp3,.m4a,.wav, etc.) - Send the link to your bot:
Asta uses faster-whisper for transcription. First transcription may take 10-30 seconds while the model loads.
Exec Command Approval Flow
When Asta wants to run a command (inallowlist mode) that requires approval, Telegram shows inline buttons:
User taps a button
- Once: Runs the command this time only
- Always: Adds the binary to the allowlist and runs the command
- Deny: Blocks the command
Viewing Pending Approvals
Configuration Reference
Environment Variables
Settings Panel
In Settings → Telegram:- Bot Token: Your BotFather token
- Allowed User IDs: Comma-separated numeric IDs
- Enable Bot: Toggle to start/stop the bot
Troubleshooting
Bot doesn't respond
Bot doesn't respond
Check bot token:Restart backend:
- Ensure
TELEGRAM_BOT_TOKENis set in.envor Settings - Verify the token is correct (no extra spaces)
'You're not authorized to use this bot'
'You're not authorized to use this bot'
Voice transcription fails
Voice transcription fails
Check faster-whisper:If not installed:First transcription is slow: The whisper model downloads on first use (~75 MB). Subsequent transcriptions are faster.
Exec approvals not showing
Exec approvals not showing
Ensure:
- Exec mode is
allowlist:/exec_mode - The command binary is not in the allowlist:
/allowlist - You’re in the same chat where the original request was made
Advanced: Custom Commands
Source:~/workspace/source/backend/app/channels/telegram_bot.py
You can add custom Telegram commands by editing the bot handler:
Next Steps
- Exec Tool Security - Understand command execution modes
- Creating Skills - Build custom workspace skills
- Subagent Orchestration - Run background tasks