OpenWalrusOpenWalrus

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 daemon

The daemon spawns the gateway, which starts the Telegram bot automatically.

Discord

1. Create a bot

  1. Go to the Discord Developer Portal
  2. Create a new application
  3. Go to Bot settings and create a bot
  4. Copy the bot token
  5. Enable the Message Content Intent under Privileged Gateway Intents
  6. 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 daemon

The gateway connects to Discord and listens for messages.

Message flow

  1. User sends a message on Telegram or Discord
  2. The gateway receives it and forwards to the daemon via the walrus protocol
  3. The daemon's event loop dispatches it to the target agent
  4. 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

On this page