Quick Start
Install Bot Dependencies
Install the bot integration package:This adds support for Telegram, Discord, Slack, and WhatsApp platforms.
Launch Gateway with Channels
Start the integrated gateway with channel bot support:This starts Pattern B host integration with channels feature enabled.
All configured channels now start reliably from a single gateway, resolving the previous
cannot pickle '_thread.RLock' object error through automatic Agent Cloning.Platform Configuration
Telegram Setup
- Create bot with @BotFather
- Get your bot token
- Set environment variable:
Discord Setup
- Create application in Discord Developer Portal
- Create bot and get token
- Set environment variable:
Slack Setup
- Create Slack app in Slack API
- Get Bot User OAuth Token and App-Level Token
- Set environment variables:
WhatsApp Setup
- Set up WhatsApp Business API
- Get access token and phone number ID
- Set environment variables:
Gateway Patterns
Pattern B: In-Process Host
Run channels within your application process:Pattern C: Integrated Gateway
Single process with WebSocket support:- Chat UI at
http://localhost:8080 - REST API at
http://localhost:8080/api - WebSocket at
ws://localhost:8080/ws - Bot integrations auto-start based on environment variables
Legacy Mode
For callback-only integration without provider wiring:@aiui.reply callbacks without automatic agent integration.
BotOS Multi-Platform Orchestration
UseBotOS for advanced multi-platform management:
Channel Features Integration
Thepraisonaiui.features.channels module provides:
| Feature | Description |
|---|---|
| Auto-detection | Platforms start automatically when environment variables are set |
| Session Management | Each user gets persistent sessions across bot restarts |
| Gateway Integration | Works seamlessly with Pattern B/C host integration |
| WebSocket Support | Real-time updates via /ws endpoint in Pattern C |
Channel Security
All channels enforce the same access-control pipeline regardless of whether you run them viapraisonai bot start or praisonai gateway start.
| Feature | Standalone Bot | Gateway Mode |
|---|---|---|
User allowlist (allowed_users) | ✅ | ✅ |
Channel allowlist (allowed_channels) | ✅ | ✅ |
| Unknown user pairing | ✅ | ✅ |
| Group policy enforcement | ✅ | ✅ |
Gateway YAML Reference
Complete YAML field documentation and pipeline diagram
BotConfig Reference
Standalone bot configuration options
Platform-Specific Features
Telegram
- Supports markdown formatting
- File uploads and downloads
- Inline keyboards
- Command handling (
/start,/help)
Discord
- Rich embeds and attachments
- Slash commands
- Thread support
- Role-based permissions
Slack
- Block kit UI components
- App Home tab
- Workflow integration
- Enterprise security features
- Media message support
- Template messages
- Business API features
- Webhook verification
Development vs Production
- Development
- Production
Troubleshooting
Common Issues
Bot not starting
Bot not starting
Check environment variables are set correctly:
Messages not reaching agents
Messages not reaching agents
Ensure gateway is running with proper agent configuration:
WebSocket connection issues
WebSocket connection issues
For Pattern C, ensure WebSocket endpoint is accessible:
Best Practices
Use environment variables for tokens
Use environment variables for tokens
Never hardcode tokens in source code:
Handle rate limits gracefully
Handle rate limits gracefully
Different platforms have different rate limits:
Monitor bot health
Monitor bot health
Set up monitoring for production deployments:
Related
Host Integration
Pattern B/C integration
Integration Patterns
Pattern comparison

