Discord Gateway
clawzero connects to Discord using the serenity library and responds to messages.
Prerequisites
- Create a Discord application at discord.com/developers/applications
- Under Bot, create a bot and copy the Token → this is your
DISCORD_BOT_TOKEN - Enable Message Content Intent under Bot → Privileged Gateway Intents
- Generate an invite URL under OAuth2 → URL Generator:
- Scopes:
bot - Bot Permissions:
Send Messages,Read Message History
- Scopes:
- Invite the bot to your server using the generated URL
Configuration
Environment variables
export DISCORD_BOT_TOKEN="your-discord-bot-token"
Config file
[gateway.discord]
bot_token_env = "DISCORD_BOT_TOKEN"
Or with a direct value:
[gateway.discord]
bot_token = "your-discord-bot-token"
Running
# Discord only
clawzero gateway discord
# All configured gateways
clawzero gateway
Build
Discord support requires the discord feature flag:
cargo install --path . --features discord
Behavior
- Each Discord channel gets its own agent session
- The bot responds with streaming message edits
- Message updates are rate-limited to avoid Discord API throttling