Discord Bot Setup
Connect Discord to Edictum for interactive approval buttons -- Approve/Deny directly in Discord.
Right page if: you are connecting a Discord bot to Edictum Console for interactive approve/deny buttons. Wrong page if: you want Telegram or Slack buttons -- see https://docs.edictum.ai/docs/console/notifications/telegram or https://docs.edictum.ai/docs/console/notifications/slack. Gotcha: Discord uses Ed25519 signature verification (not HMAC). The Interactions Endpoint URL must be set and verified before buttons work -- Discord sends a PING that must be answered within 3 seconds.
Connect Discord to Edictum for interactive approval buttons -- Approve/Deny directly in Discord.
1. Create the Application
- Go to discord.com/developers/applications
- Click New Application > give it a name (e.g. "Edictum")
- On General Information, copy the Public Key -- you'll need this later
2. Create the Bot
- Left sidebar > Bot
- Click Reset Token > copy the token (
MTQ...) -- shown once, save it now - This is your
bot_token
3. Set Up Interactions Endpoint
- Left sidebar > General Information
- Set Interactions Endpoint URL to:
https://your-server.com/api/v1/discord/interactions - Discord sends a PING to verify -- your console must be running and reachable via HTTPS
- Click Save Changes
4. Invite the Bot to Your Server
- Left sidebar > OAuth2 > URL Generator
- Scopes: check
bot - Bot Permissions: check
Send Messages - Copy the generated URL > open it in your browser > select your server > Authorize
5. Get the Channel ID
- In Discord > User Settings > Advanced > enable Developer Mode
- Right-click the channel where approvals should be posted > Copy Channel ID
6. Add the Channel in Edictum
- Dashboard > Settings > Notifications > Add Channel > Discord
- Fill in:
- Bot Token: from step 2
- Public Key: from step 1
- Channel ID: from step 5
- Click Test -- a test message should appear in the channel
What Happens
When an agent requests approval:
- A message appears in your Discord channel with Approve and Deny buttons
- Click a button > decision submitted to Edictum instantly
- The message updates to show the result
- The approval is also visible in the Edictum dashboard
Interactive buttons require the server to be reachable via HTTPS. Sending notifications works without it; button interactions do not.
Interaction Verification
The console verifies every Discord interaction using:
- Ed25519 signature verification -- Discord signs each interaction request with your application's public key. The console verifies the signature before processing.
- PING handshake -- Discord sends a PING request to your interactions endpoint during setup. The console responds with a PONG to confirm the endpoint is valid.
This ensures button clicks genuinely come from Discord.
Troubleshooting
| Problem | Fix |
|---|---|
Test says Missing Access (code 50001) | Bot hasn't been invited to the server -- open the OAuth URL and authorize it |
Test says Missing Permissions | Bot lacks Send Messages in that channel -- check channel-level permission overrides |
| Buttons don't work | EDICTUM_BASE_URL must be a public HTTPS URL; localhost won't receive Discord interaction callbacks |
| Bot token stopped working | You may have reset it -- copy the new token from the Bot page and update it in Edictum |
| Interactions endpoint won't verify | Your server must respond to Discord's PING within 3 seconds. Check that EDICTUM_BASE_URL is correct and the server is running. |
Invalid interaction errors in logs | The public key in Edictum doesn't match the one in Discord Developer Portal. Re-copy it. |
Security Note
Treat the bot token like a password. If you accidentally share it (e.g. in a screenshot or chat):
- Go to Discord Developer Portal > Bot > Reset Token
- Copy the new token
- Update it in Edictum dashboard
The bot token is encrypted at rest in the console database.
Next Steps
- Notification Overview -- routing filters and channel management
- Telegram Setup -- add Telegram as another channel
- Slack App Setup -- add Slack as another channel
Last updated on