π Gateway Guide
π What is the Gateway?
The ClawdBot Gateway is the central hub that connects all messaging platforms to your AI backend.
Key Features
- β Unified conversation context across platforms
- β Automatic message routing
- β Cross-platform user identity
- β Load balancing and rate limiting
- β Message queue management
ποΈ Architecture
βββββββββββββββββββββββββββββββββββββββββββ
β Messaging Platforms β
ββββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββ€
β Telegram β WhatsApp β Discord β iMessageβ
ββββββ¬ββββββ΄βββββ¬ββββββ΄βββββ¬ββββββ΄βββββ¬ββββ
β β β β
ββββββββββββ΄βββββββββββ΄βββββββββββ
β
βββββββββΌβββββββββ
β Gateway β
β (Router) β
βββββββββ¬βββββββββ
β
ββββββββββββββββΌβββββββββββββββ
β β β
ββββββΌβββββ βββββββΌββββββ ββββββΌβββββ
β Claude β β GPT-4 β β Gemini β
βββββββββββ βββββββββββββ βββββββββββ
π± Supported Channels
| Channel | Status | Features |
|---|---|---|
| Telegram | β Full Support | Bots, groups, inline |
| β Full Support | Personal, groups | |
| Discord | β Full Support | Servers, DMs, slash commands |
| iMessage (macOS) | β macOS Only | Personal messages |
| Slack | β οΈ Beta | Workspaces |
| Matrix | β οΈ Experimental | Federated chat |
π Message Routing
Basic Routing
# config.yaml
gateway:
routing:
# Default AI provider
default: "anthropic"
# Route by channel
byChannel:
telegram: "claude-3-5-sonnet"
whatsapp: "gpt-4"
discord: "gemini-pro"
Advanced Routing
gateway:
routing:
rules:
# Route coding questions to Claude
- pattern: "code|debug|refactor"
provider: "anthropic"
model: "claude-3-5-sonnet"
# Route creative tasks to GPT-4
- pattern: "write|story|creative"
provider: "openai"
model: "gpt-4"
# Route simple questions to Gemini (cheap)
- pattern: "what|when|where|who"
provider: "google"
model: "gemini-1.5-flash"
βοΈ Gateway Configuration
# config.yaml
gateway:
port: 3000
host: "0.0.0.0"
# Channels
channels:
telegram:
enabled: true
whatsapp:
enabled: true
discord:
enabled: true
# Rate limiting
rateLimit:
enabled: true
maxRequestsPerMinute: 60
maxRequestsPerHour: 1000
# Queue management
queue:
enabled: true
maxSize: 1000
processingTimeout: 60000
# Logging
logging:
level: "info"
format: "json"
β Gateway FAQ
Can I use multiple AI providers simultaneously?
Yes! Configure routing rules to use different providers for different tasks
or channels.
Does conversation context persist across platforms?
Yes, if you link user identities across platforms in config.
How do I add a new messaging platform?
Create a channel adapter following the ClawdBot channel API. See developer
docs.