Discord Channel
Discord channels connect one Discord bot to one Netmind Cloud Agent. NCA receives messages through the Discord Gateway WebSocket and sends replies through the Discord REST API.
Discord does not use an NCA inbound webhook URL. The bot token is enough for NCA to open the Gateway connection.
Prerequisites
CHANNELS_ENABLED=trueon the API service- An existing NCA agent
- Permission to create a Discord application and invite it to the target server
The current Admin channel form does not expose Discord yet. Create Discord channels through the API.
Create the Discord application
- Open the Discord Developer Portal.
- Create a new application.
- Open Bot and create a bot user.
- Reset and copy the bot token.
- Enable Message Content Intent under Privileged Gateway Intents.
Message Content Intent is required. Without it, NCA can connect but cannot read prompts.
Invite the bot
Open OAuth2 URL Generator:
- Select the
botscope. - Select these bot permissions:
| Permission | Why |
|---|---|
| View Channels | Let the bot see messages in target channels. |
| Send Messages | Send agent replies. |
| Read Message History | Read message context delivered by the Gateway. |
Copy the generated URL, open it, and invite the bot to the server.
API payload
{
"agentId": "agt_...",
"provider": "discord",
"label": "engineering-discord",
"config": {
"allowedGuildIds": [],
"mentionOnly": true,
"shareSessionInChannel": false,
"threadIsolation": false,
"progressMode": "preview"
},
"credentials": {
"botToken": "..."
}
}
Send this body to POST /api/channels. NCA validates the token, fetches bot and application identity, verifies Message Content Intent, and activates the channel when registration succeeds.
Configuration
| Field | Required | Default | Notes |
|---|---|---|---|
botUserId | No | Auto-filled | Discord bot user ID returned during registration. Used to ignore self messages and detect mentions. |
botName | No | Auto-filled | Bot username returned during registration. |
applicationId | No | Auto-filled | Discord application ID returned during registration. |
allowedGuildIds | No | [] | Empty means all joined servers are accepted. Set one or more guild IDs to restrict the channel. |
mentionOnly | No | true | In servers, only respond when the bot is mentioned. DMs always respond. |
shareSessionInChannel | No | false | When true, users in the same guild channel share one agent session. |
threadIsolation | No | false | Accepted for config parity. The current Discord provider scopes by DM user, or by guild channel and user unless shareSessionInChannel=true. |
progressMode | No | preview | preview edits one progress message while the agent works. final only sends the final reply. |
Credentials
| Field | Required | Notes |
|---|---|---|
botToken | Yes | Bot token from the Developer Portal. Stored encrypted. |
Verify
Use the channel test endpoint:
curl -X POST "$NCA_API_URL/channels/{channelId}/test" \
-H "Authorization: Bearer $NCA_TOKEN"
A healthy channel reports the bot identity and confirms that Message Content Intent is enabled.
Troubleshooting
MESSAGE_CONTENT intent disabled: enable Message Content Intent in Developer Portal, then update credentials or register the channel again.- Bot connects but ignores server messages: mention the bot or set
mentionOnly=false. - Messages from a server are ignored: check
allowedGuildIdsor clear the list to allow all joined servers. - Bot cannot send replies: re-invite it with View Channels, Send Messages, and Read Message History permissions.