Discord
Connect the agent to Discord through the interactions endpoint, to answer slash commands and components.
Discord
The Discord integration lets the agent answer slash commands and message components in Discord servers, through the interactions endpoint.
Reach it through the Settings icon → Integrations tab → the Discord card.
Turning the integration on
Turn on the toggle in the Discord card. The configuration fields appear once it is on.
How it works
- A user runs a command (a slash command or a button) in a server where the bot is installed.
- Discord sends the interaction to Roberty's public endpoint.
- Roberty validates the Ed25519 signature with the application's public key.
- The agent runs and the answer comes back in the same request.
This integration does not use the WebSocket gateway; it works only with the HTTP interactions model. That keeps the operation simple (no live connection to hold open) but limits it to commands and components — messages in ordinary channels are not processed.
The configuration fields
| Field | Required | What it is |
|---|---|---|
| Bot Token | Yes | The token from the Bot tab in the Discord Developer Portal |
| Public Key | Yes | The application's public key, from the General Information tab |
| Guild ID | No | Restricts the bot to a single server (the Discord server's ID) |
| Channel ID | No | Restricts the bot to a single channel within that server |
Creating the bot in the Discord Developer Portal
1. Create the application
- Go to the Discord Developer Portal and create a new application.
- On the Bot tab, click Reset Token and note the value (shown once) — that is the Bot Token.
- On the General Information tab, copy the Public Key and the Application ID.
2. Configure the interactions endpoint
On the application's General Information tab, set Interactions Endpoint URL to:
https://agent-backend.roberty.app/integrations/discord/<AGENT_ID>
Replace <AGENT_ID> with the ID of the Roberty agent that will receive the interactions — use Copy ID at the top of the Integrations tab.
On save, Discord sends a PING and requires a valid answer; Roberty's endpoint already answers correctly, as long as the public key is configured on the agent.
3. Configure the agent in Roberty
Fill in Bot Token, Public Key and, optionally, Guild ID and Channel ID to restrict the bot.
4. Add the bot to the server
- In the Discord portal, go to OAuth2 → URL Generator.
- Tick the
bot applications.commandsscope and the permissions you want. - Open the generated URL and pick the server.
5. Register the slash commands
Register them through Discord's API (with curl, for example):
curl -X POST \
-H "Authorization: Bot YOUR_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"ask","description":"Ask the agent","options":[{"type":3,"name":"message","description":"Your question","required":true}]}' \
"https://discord.com/api/v10/applications/APPLICATION_ID/commands"
Roberty takes the value of the first text parameter (type 3) as the agent's input.
Security validation
Every request must carry:
X-Signature-Ed25519X-Signature-Timestamp
Roberty checks the signature with the agent's publicKey and answers 401 Invalid signature if it does not hold.
The interaction types it handles
| Type | What happens |
|---|---|
1 PING | Answered { type: 1 } automatically. |
2 APPLICATION_COMMAND | Runs the agent with the first text parameter. |
3 MESSAGE_COMPONENT | Runs the agent using the custom_id as the input. |
The agent's answer is truncated at 2000 characters (Discord's limit for a single message).