Netmind Cloud Agents
← Docs

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=true on 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

  1. Open the Discord Developer Portal.
  2. Create a new application.
  3. Open Bot and create a bot user.
  4. Reset and copy the bot token.
  5. 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:

  1. Select the bot scope.
  2. Select these bot permissions:
PermissionWhy
View ChannelsLet the bot see messages in target channels.
Send MessagesSend agent replies.
Read Message HistoryRead 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

FieldRequiredDefaultNotes
botUserIdNoAuto-filledDiscord bot user ID returned during registration. Used to ignore self messages and detect mentions.
botNameNoAuto-filledBot username returned during registration.
applicationIdNoAuto-filledDiscord application ID returned during registration.
allowedGuildIdsNo[]Empty means all joined servers are accepted. Set one or more guild IDs to restrict the channel.
mentionOnlyNotrueIn servers, only respond when the bot is mentioned. DMs always respond.
shareSessionInChannelNofalseWhen true, users in the same guild channel share one agent session.
threadIsolationNofalseAccepted for config parity. The current Discord provider scopes by DM user, or by guild channel and user unless shareSessionInChannel=true.
progressModeNopreviewpreview edits one progress message while the agent works. final only sends the final reply.

Credentials

FieldRequiredNotes
botTokenYesBot 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 allowedGuildIds or 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.

See also