Connect NullClaw to Telegram to receive messages and interact with your AI assistant via Telegram’s messaging platform.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.
Prerequisites
- Telegram account
- BotFather access to create bot tokens
- Your Telegram user ID (numeric)
Quick Setup
Create Bot with BotFather
Open @BotFather in Telegram and send
/newbot. Follow prompts to get your bot token.Get Your User ID
Message @userinfobot to find your numeric user ID (e.g.,
123456789).Configure NullClaw
Run
nullclaw onboard --interactive and select Telegram when prompted, or edit config manually.Configuration
Basic Setup
Edit~/.nullclaw/config.json:
config.json
Complete Configuration
config.json
Configuration Options
bot_token (required)
Your Telegram bot token from BotFather:How to get bot token
How to get bot token
- Open Telegram and search for @BotFather
- Send
/newbotcommand - Choose a name (display name)
- Choose a username (must end in
bot) - Copy the token provided
allow_from (required)
Usernames or user IDs allowed to message your bot:- Specific Users
- Allow All
- Numeric IDs
@alice and @bob can message the bot.reply_in_private
Control where the bot replies:true: Bot replies via DM even if mentioned in groupsfalse: Bot replies in the same chat where mentioned
proxy
Optional SOCKS5 proxy for regions where Telegram is blocked:socks5://host:portsocks5://user:pass@host:port
Multiple Accounts
Run multiple Telegram bots simultaneously:config.json
Bot Commands
NullClaw registers these commands automatically:| Command | Description |
|---|---|
/start | Start a conversation |
/new | Clear history, start fresh |
/help | Show available commands |
/status | Show model and stats |
/model | Switch AI model |
/memory | Memory tools and diagnostics |
/stop | Stop active background task |
Media Support
Telegram channel supports:Images
Send photos for vision model analysis
Documents
Attach files for processing
Audio
Voice messages (transcribed via Whisper)
Video
Video files and messages
Voice Message Transcription
Enable audio transcription:config.json
Running the Bot
Gateway Mode (Recommended)
Run all channels including Telegram:http://127.0.0.1:3000 (default).
Standalone Channel
Run only Telegram channel:Background Service
Install as system service:Security Best Practices
Use Allowlists
Use Allowlists
Always specify Never use
allow_from to prevent unauthorized access:["*"] in production.Encrypt Bot Token
Encrypt Bot Token
Enable secret encryption:Tokens are encrypted with ChaCha20-Poly1305.
Use Pairing
Use Pairing
Keep gateway pairing enabled:
Limit Actions
Limit Actions
Restrict autonomy level:
Troubleshooting
Bot Not Responding
Messages Ignored
Common causes:- Username not in
allow_from(case-sensitive) - Bot token revoked or expired
- Network/proxy issues
- Rate limiting (too many messages)
Proxy Not Working
Verify proxy format:Advanced Configuration
Group Chat Handling
For group chats, configure reply behavior:config.json
- Add bot to group as admin
- Bot responds only when mentioned with
@botname - Set
reply_in_private: falseto reply in group
Rate Limiting
Telegram has built-in rate limits. NullClaw handles:- Media group coalescing (3-second flush)
- Automatic retry with backoff
- Message splitting at 2000 characters
Next Steps
Discord Setup
Configure Discord bot
Memory Backend
Set up vector search