The Telegram channel connects NullClaw to Telegram using the Bot API with long-polling for message delivery.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nullclaw/nullclaw/llms.txt
Use this file to discover all available pages before exploring further.
Features
- Long-polling for real-time message delivery
- Media support (images, documents, video, audio, voice)
- Media groups with automatic batching
- Reply-in-private mode for group chats
- Proxy support (HTTP/SOCKS5)
- Typing indicators
- Voice message transcription
- Interactive buttons (NullClaw interactions)
Configuration
Add Telegram to yourconfig.json:
Configuration Options
Telegram bot token from @BotFather
List of allowed Telegram user IDs. Use
"*" to allow everyone (not recommended).Finding your user ID: Send a message to your bot, then check the logs or use @userinfobotWhen
true, bot replies to group messages via private DM instead of in the group chatHTTP/SOCKS5 proxy URL for API requests (e.g.,
"http://proxy.example.com:8080" or "socks5://127.0.0.1:1080")Automatically transcribe voice messages using the configured speech-to-text provider
Account identifier for multi-account setups
Setup Guide
Create a Telegram Bot
- Open Telegram and search for @BotFather
- Send
/newbotand follow the prompts - Choose a name and username for your bot
- Copy the bot token (looks like
123456789:ABCdefGHIjklMNOpqrsTUVwxyz)
Get Your User ID
- Send a message to your new bot
- Visit
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Find your user ID in the
from.idfield
Proxy Configuration
If you’re in a region where Telegram is restricted, configure a proxy:HTTP Proxy
SOCKS5 Proxy
Media Support
The Telegram channel supports sending and receiving various media types:Supported Media Types
- Images (PNG, JPEG, GIF, WebP)
- Documents (PDF, TXT, ZIP, etc.)
- Video (MP4, MOV, AVI, MKV, WebM)
- Audio (MP3, M4A, WAV, FLAC)
- Voice (OGG, Opus)
Sending Media
Use file paths or URLs in your messages:Media Groups
When multiple images are sent together, they’re automatically batched into a media group for better presentation.Voice Transcription
Whentranscribe_voice is enabled, voice messages are automatically transcribed using your configured speech-to-text provider. The transcription is included in the message content sent to the agent.
Group Chat Support
Standard Group Replies
By default, the bot replies directly in the group:Private Replies
Enablereply_in_private to have the bot DM responses instead:
- Keeping group chats clean
- Private interactions in public groups
- Sensitive information handling
Multiple Accounts
You can run multiple Telegram bots simultaneously:Message Limits
Telegram enforces a 4096 character limit per message. NullClaw automatically splits longer messages while respecting UTF-8 character boundaries.Bot Commands
The Telegram channel automatically registers these commands with @BotFather:/start— Start a conversation/new— Clear history, start fresh/reset— Alias for /new/help— Show available commands/status— Show model and stats/whoami— Show current session id/model— Switch model/think— Set thinking level/verbose— Set verbose level/exec— Set execution policy/memory— Memory tools and diagnostics/stop— Stop active background task
Troubleshooting
Bot Not Responding
- Verify bot token is correct
- Check that your user ID is in
allow_from - Ensure NullClaw is running
- Check logs for errors:
nullclaw --log-level debug
Proxy Connection Failed
- Verify proxy URL format
- Test proxy with curl:
curl -x "http://proxy:8080" https://api.telegram.org - Check proxy authentication if required
Media Not Sending
- Verify file path is absolute or URL is accessible
- Check file size limits (20MB for photos, 50MB for other media)
- Ensure file format is supported by Telegram
Source Code
Implementation:src/channels/telegram.zig