Discord¶
Discord uses a bot application and the shared gateway bridge.
Create the App and Bot¶
- Open the Discord Developer Portal.
- Create an application.
- Add a bot user.
- Copy the bot token into
team.env:
DISCORD_BOT_TOKEN=...
- Invite the bot with the
botscope. Theapplications.commandsscope is included for slash commands. - Enable
MESSAGE CONTENT INTENTif ordinary non-command channel messages should be bridged.
Onboarding Flags¶
.venv/bin/python assistant_cli.py onboard \
--enable-discord \
--discord-allow-user-id 123456789012345678 \
--discord-allow-channel-id 123456789012345678 \
--discord-command-guild-id 123456789012345678
If Discord should receive proactive messages:
--default-delivery-channel discord \
--default-delivery-chat-id 123456789012345678 \
--default-delivery-thread-id 123456789012345678
Sessions and Threads¶
Discord sessions bind to parent channel plus optional thread id. Messages inside a Discord thread stay on the same conversation lane.
Enable thread-scoped sessions when you want independent conversations by thread:
--discord-thread-scoped-sessions
Group Policy¶
discord.group_policy controls how guild channels accept ordinary text:
- open channel traffic,
- mention-only traffic,
- or stricter allowlist behavior.
Use allowlists for production deployments.
Verification¶
- Start the gateway.
- Confirm slash command sync logs appear.
- Run
/helpin an allowed guild/channel. - Send a simple request from an allowed user.
- Confirm Discord shows activity while the agent works.
- Confirm replies stay in the originating channel/thread.
- Test proactive delivery if Discord is the default target.
Troubleshooting¶
- Slash commands missing: configure
--discord-command-guild-idfor immediate guild sync, then restart. - Ordinary messages ignored: enable Message Content Intent and check group policy.
- Replies appear in the wrong place: verify default delivery channel/thread id and thread-scoped session setting.
- Startup fails: verify
DISCORD_BOT_TOKENis present in the gateway env.