Overview
rousseau discord runs the Discord Gateway bridge. It connects to Discord's Gateway v10 WebSocket, subscribes to MESSAGE_CREATE events with the Message Content intent, and posts replies via the REST API. Outbound WebSocket only — no public HTTP surface.
Source: internal/cli/discord.go. Transport: internal/transport/discord/.
Synopsis
rousseau discord [--token <bot-token>] [--allow <user-id>...] [--config <path>]
Flags
| Flag | Type | Default | Effect |
|---|---|---|---|
--token |
string | discord.token |
Bot token from the Developer Portal. |
--allow |
[]string | discord.allowlist |
Restrict inbound to these Discord user IDs. |
--config |
string | inherits from root | Path to the YAML config file. |
Config keys respected
internal/config/config.go DiscordConfig:
| Key | Type | Default | Effect |
|---|---|---|---|
discord.token |
string | empty | Bot token. |
discord.reply_header |
string | empty | Prefix on outbound messages. |
discord.allowlist |
[]string | empty | Discord user IDs (snowflakes as strings). |
Allowlist syntax
Discord user IDs are 17–20 digit snowflakes:
discord:
allowlist:
- "123456789012345678"
- "987654321098765432"
To find your own id, enable Developer Mode in Discord settings, then right-click your name and pick "Copy User ID". Or read router.transport.received in the logs with an empty allowlist.
Environment variables
| Variable | Effect |
|---|---|
ROUSSEAU_DISCORD_TOKEN |
Overrides discord.token. |
Startup sequence
- Resolve token from flag/env/config; fail if empty.
- Default
claudecli.permission_modetobypassPermissions. - Open session store, build agent wiring.
discord.New— Gateway client with required intents.wiring.startCron— cron delivery via REST.- Gateway WebSocket loop until context cancelled.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Clean context cancellation. |
| 1 | Missing token, WebSocket failure, provider/store error. |
| 130 | SIGINT. |
Worked examples
# Ad-hoc bot for one user
rousseau discord --token "MTIz…" --allow "123456789012345678"
# From config
cat > ~/.config/rousseau/config.yaml <<'EOF'
discord:
token: "MTIz…"
allowlist:
- "123456789012345678"
EOF
rousseau discord
Common failure modes
401 Unauthorized— invalid token. Regenerate in the Developer Portal.- Bot sees no message content — Message Content intent not enabled.
Sharding required— the bot joined 2500+ guilds. Rousseau does not shard; use a smaller deployment.- Silent inbound drops — sender snowflake not on the allowlist.