/investigate slash command. The gateway connects over Discord’s Gateway WebSocket with discord.py — you do not need a public /discord/interactions URL for normal operation.
Prerequisites
- A Discord server where you can add applications (Manage Server).
- An OpenSRE host running
opensre gateway start(local or deployed). - Discord Privileged Gateway Intent: Message Content enabled for the bot (required to read @mentions and thread replies in servers).
Step 1: Create a Discord application and bot
- Go to the Discord Developer Portal and click New Application.
- Open the Bot tab:
- Copy the Token (
DISCORD_BOT_TOKEN). - Enable Message Content Intent under Privileged Gateway Intents.
- Copy the Token (
- On General Information, copy Application ID and Public Key (still used by onboarding and optional HTTP tooling).
Step 2: Invite the bot with the right permissions
In OAuth2 → URL Generator, select scopesbot and applications.commands, then bot permissions:
- View Channels
- Read Message History
- Send Messages
- Send Messages in Threads
- Embed Links
- Add Reactions
- Use Application Commands
Step 3: Configure OpenSRE
Run onboarding and select Discord, or set env vars:
Discord turns are billed and stored against the organization in
ORGANIZATION_ID. Without it every turn is refused — the bot appears
online and silently does nothing, and the reason is only in the gateway log.
Set DISCORD_SILO_GUILD_IDS on any deployment holding real credentials.
Leaving it unset means any server that adds the bot inherits that
organization’s integrations.
Approving a write action always requires DISCORD_ALLOWED_USERS.
DISCORD_ALLOW_OPEN_GUILD opens chat, never approvals, so with no allowlist
every Approve/Deny click is ignored.
Allow yourself explicitly:
discord: connected via gateway.
Step 4: Chat and investigate
- DM the bot, @mention it in a channel, or reply in a thread where it is already engaged.
- Slash command (registered at onboarding):
/new, /help, and /pair <code> work in Discord text.
Each member gets their own conversation, even in a shared channel: your history
and /new never affect a teammate’s. Integrations you connect are shared by the
whole organization.
Troubleshooting
Bot online but ignores channel messages Enable Message Content Intent in the Developer Portal and restart the gateway. Ensure your user id is on the allowlist (opensre messaging list or DISCORD_ALLOWED_USERS).
/investigate missing
Re-run opensre onboard to re-register commands. Global commands can take up to an hour to propagate.
Gateway shows Discord not configured
Set DISCORD_BOT_TOKEN and at least one allowed user (or DISCORD_ALLOW_OPEN_GUILD=1).