Overview
Telegram is one of the most popular platforms for Praxos, offering rich features, speed, and security.Features
- Text messaging
- Voice messages
- File sharing (documents, images, videos)
- Inline keyboards for interactive commands
- Real-time responses
- Group chat support
Setup
1. Create a Telegram Bot
- Open Telegram and search for @BotFather
- Send
/newbotcommand - Follow prompts to name your bot
- Copy the bot token provided
2. Configure Praxos
Add the token to your.env file:
3. Set Webhook (Production)
For production deployments, configure a webhook:For local development, Praxos uses polling mode automatically.
4. Start Conversation
- Find your bot in Telegram (search for the username you created)
- Send
/startto initialize - Begin chatting with Praxos
Bot Commands
Built-in Telegram commands:| Command | Description |
|---|---|
/start | Initialize bot and show welcome message |
/help | Display available commands |
/settings | Configure preferences |
/history | View conversation history |
/clear | Clear conversation context |
Advanced Features
Group Chats
Add Praxos to group chats:- Add bot to group as member
- Grant admin permissions (optional, for better functionality)
- Mention bot using
@YourBotNameto interact - Configure group-specific settings
Inline Keyboards
Praxos can send interactive buttons:File Handling
Send files to Praxos:- Documents - PDFs, Word docs, text files
- Images - JPG, PNG (with OCR support)
- Voice Messages - Audio transcription
- Videos - Metadata extraction
Rich Formatting
Praxos supports Telegram’s formatting:- Bold, italic,
code - Links and mentions
- Code blocks with syntax highlighting
Configuration Options
Environment Variables
User Preferences
Users can configure:- Response length preference
- Notification settings
- Default timezone
- Language preference
Security
Bot Token Security
Never share your bot token publicly. Treat it like a password.
- Store token in environment variables
- Use Azure Key Vault in production
- Rotate tokens if compromised
User Privacy
- All conversations are private by default
- User data is isolated per user
- Praxos never shares messages with other users
Rate Limiting
Telegram’s limits:- 30 messages per second per bot
- 20 messages per minute per chat
- Praxos automatically queues and throttles
Troubleshooting
Bot Not Responding
Check ConfigurationWebhook Issues
Verify Webhook Status- SSL certificate issues (webhook requires HTTPS)
- Firewall blocking incoming requests
- Incorrect webhook URL
Message Formatting Errors
- Use
parse_mode=Markdownfor Markdown formatting - Escape special characters:
_,*,[,],(,),~,`,>,#,+,-,=,|,{,},.,! - Or use HTML mode with proper tags
Best Practices
User Experience
- Quick Responses - Send typing indicators for long operations
- Clear Messages - Format responses clearly with proper structure
- Interactive Elements - Use inline keyboards for common actions
- File Support - Accept multiple file types
Performance
- Async Operations - All Telegram API calls are async
- Connection Pooling - Reuse HTTP connections
- Retry Logic - Automatic retries for transient failures
- Caching - Cache user context to reduce database calls
Monitoring
Track key metrics:- Message processing time
- Error rates
- Active users
- API call volumes