Skip to main content

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

  1. Open Telegram and search for @BotFather
  2. Send /newbot command
  3. Follow prompts to name your bot
  4. 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

  1. Find your bot in Telegram (search for the username you created)
  2. Send /start to initialize
  3. Begin chatting with Praxos

Bot Commands

Built-in Telegram commands:

Advanced Features

Group Chats

Add Praxos to group chats:
  1. Add bot to group as member
  2. Grant admin permissions (optional, for better functionality)
  3. Mention bot using @YourBotName to interact
  4. 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 Configuration
Check Logs

Webhook Issues

Verify Webhook Status
Common Problems
  • SSL certificate issues (webhook requires HTTPS)
  • Firewall blocking incoming requests
  • Incorrect webhook URL
Delete Webhook (for local dev)

Message Formatting Errors

  • Use parse_mode=Markdown for 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

Example Interactions

Simple Query

Task Creation

File Processing

Next Steps

Tools Overview

Explore what Praxos can do

Add More Integrations

Connect additional services