Gateway
Deploy OpenWalrus agents as Telegram and Discord bots via the gateway service.
The gateway service (wgateway) connects messaging platforms to OpenWalrus agents. It runs as a managed client service — the daemon spawns it, and it connects back to route messages.
Configuration
Add the gateway to walrus.toml:
[services.gateway]
kind = "client"
command = "wgateway"
enabled = true
config = { telegram = { token = "..." }, discord = { token = "..." } }You can enable one or both platforms in the same gateway process.
Telegram
1. Create a bot
Talk to @BotFather on Telegram and create a new bot. Copy the bot token.
2. Configure
[services.gateway]
kind = "client"
command = "wgateway"
enabled = true
config = { telegram = { token = "123456:ABC-DEF..." } }3. Start the daemon
walrus daemonThe daemon spawns the gateway, which starts the Telegram bot automatically.
Discord
1. Create a bot
- Go to the Discord Developer Portal
- Create a new application
- Go to Bot settings and create a bot
- Copy the bot token
- Enable the Message Content Intent under Privileged Gateway Intents
- Invite the bot to your server with appropriate permissions
2. Configure
[services.gateway]
kind = "client"
command = "wgateway"
enabled = true
config = { discord = { token = "your-bot-token" } }3. Start the daemon
walrus daemonThe gateway connects to Discord and listens for messages.
Message flow
- User sends a message on Telegram or Discord
- The gateway receives it and forwards to the daemon via the walrus protocol
- The daemon's event loop dispatches it to the target agent
- Agent responses stream back through the gateway to the platform
Both platforms
Run Telegram and Discord simultaneously:
[services.gateway]
kind = "client"
command = "wgateway"
enabled = true
config = { telegram = { token = "..." }, discord = { token = "..." } }What's next
- WHS services — how managed services work
- Event loop — how messages flow through the system
- Agents — configure the agent that handles messages