Discord Setup¶
Missy's Discord channel implements the full WebSocket Gateway API with slash commands (/ask, /status, /model, /help), access control, and audit logging.
Prerequisites¶
- A Discord application and bot token from the Discord Developer Portal.
- The bot's application ID (found on the General Information page).
- Network policy allowing Discord hosts.
Step 1: Create a Discord bot¶
- Go to discord.com/developers/applications.
- Click New Application, give it a name.
- Go to Bot in the sidebar, click Reset Token, and copy the token.
- Under Privileged Gateway Intents, enable Message Content Intent.
- Note the Application ID from the General Information page.
Step 2: Configure Missy¶
Add the discord: section to ~/.missy/config.yaml:
discord:
enabled: true
accounts:
- token_env_var: DISCORD_BOT_TOKEN
application_id: "YOUR_APPLICATION_ID"
dm_policy: disabled # or: pairing, allowlist, open
ignore_bots: true
guild_policies:
"YOUR_GUILD_ID":
enabled: true
require_mention: true
allowed_channels: ["bot-commands"]
mode: full # full | no_tools | safe_chat_only
Never put the bot token in config.yaml
Store the token in an environment variable or the Missy vault:
# Option 1: Environment variable
export DISCORD_BOT_TOKEN="your-token-here"
# Option 2: Missy vault
missy vault set discord_bot_token "your-token-here"
For vault storage, reference it in config:
Step 3: Allow Discord network hosts¶
Discord requires outbound access to several hosts. Add them to your network policy:
Or use the discord preset if your config uses presets:
Step 4: Test connectivity¶
This verifies the bot token is valid and Discord's Gateway is reachable. Expected output:
Step 5: Register slash commands¶
Register slash commands for a specific guild (instant) or globally (up to 1 hour propagation):
# Guild-specific (recommended for testing)
missy discord register-commands --guild-id YOUR_GUILD_ID
# Global (all guilds the bot is in)
missy discord register-commands --global
Step 6: Invite the bot¶
Generate an invite URL with the required permissions:
- Go to OAuth2 > URL Generator in the Developer Portal.
- Select scopes:
bot,applications.commands. - Select permissions:
Send Messages,Read Message History,Use Slash Commands,Add Reactions. - Use the generated URL to invite the bot to your server.
Checking status¶
missy discord status # Show configuration summary
missy discord audit # Show Discord-specific audit events
Configuration reference¶
| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | Master switch for Discord channel |
accounts[].token_env_var | string | DISCORD_BOT_TOKEN | Env var containing the bot token |
accounts[].token | string | null | Direct token (supports vault:// refs) |
accounts[].application_id | string | required | Discord application ID |
accounts[].dm_policy | string | disabled | DM handling: disabled, allowlist, pairing, open |
accounts[].dm_allowlist | list | [] | User IDs for allowlist DM policy |
accounts[].ignore_bots | bool | true | Ignore messages from other bots |
accounts[].ack_reaction | string | "" | Emoji to react with on message receipt |
accounts[].auto_thread_threshold | int | 0 | Create thread after N messages (0 = disabled) |