Docs / Strand / connectors/discord

Discord Connector

Direction: Write Only | Type: discord

Send messages, manage reactions, and post via webhooks in Discord servers from your Strand workflows.

Prerequisites#

You need either a Discord Bot Token or a Webhook URL (or both):

Bot Token#

  1. Go to discord.com/developers/applications and click New Application
  2. Go to Bot in the sidebar
  3. Click Reset Token and copy the token
  4. Under Privileged Gateway Intents, enable Message Content Intent if you need to read messages
  5. Go to OAuth2 > URL Generator, select the bot scope, then select permissions:
  1. Copy the generated URL and open it to invite the bot to your server

Webhook URL#

  1. Open your Discord server
  2. Go to Channel Settings > Integrations > Webhooks
  3. Click New Webhook, name it, and copy the URL

Connector Setup#

Create a Discord connector from the Connectors page.

Configuration Fields#

Field Required Description
Name Yes Friendly name (e.g., "Production Alerts Discord")
Bot Token No* Discord bot token (encrypted at rest)
Webhook URL No* Discord webhook URL (for webhook operations only)
Timeout No Request timeout in seconds (default: 30)

\* At least one of Bot Token or Webhook URL is required.

Operations#

Send Message#

Send a message to a Discord channel using the bot.

Field Required Description
Channel ID Yes Discord channel ID (enable Developer Mode, right-click channel > Copy ID)
Message Content No* Message text with Discord markdown. Supports Jinja templates.
Embeds (JSON) No* Rich embeds as JSON array
Reply To Message ID No Message ID to reply to (creates a threaded reply)

\* At least one of Message Content or Embeds is required.

Example: Simple text message

code

**Alert:** {{ payload.service }} is {{ payload.status }}

Example: Embed

json

[
  {
    "title": "{{ payload.title }}",
    "description": "{{ payload.details }}",
    "color": 16711680,
    "fields": [
      {"name": "Service", "value": "{{ payload.service }}", "inline": true},
      {"name": "Status", "value": "{{ payload.status }}", "inline": true}
    ]
  }
]

Edit Message#

Edit an existing Discord message.

Field Required Description
Channel ID Yes Channel containing the message
Message ID Yes ID of the message to edit
New Content No Updated message text
New Embeds (JSON) No Updated embeds as JSON array

Add Reaction#

Add an emoji reaction to a message.

Field Required Description
Channel ID Yes Channel containing the message
Message ID Yes ID of the message to react to
Emoji Yes URL-encoded emoji (e.g., %F0%9F%91%8D for thumbs up) or custom emoji as name:id

Delete Message#

Delete a message from a channel.

Field Required Description
Channel ID Yes Channel containing the message
Message ID Yes ID of the message to delete

Send Webhook#

Send a message via a Discord webhook URL. Does not require a bot token.

Field Required Description
Message Content No* Message text
Override Username No Override the webhook's default display name
Override Avatar URL No Override the webhook's default avatar
Embeds (JSON) No* Rich embeds as JSON array

\* At least one of Message Content or Embeds is required.

Output#

Send Message Output#

json

{
  "success": true,
  "status": "sent",
  "data": {
    "channel_id": "1234567890123456789",
    "message_id": "1234567890123456790",
    "content": "Alert: API is down"
  },
  "service": "discord",
  "operation": "send_message"
}

Key fields for subsequent nodes:

Errors#

Error Meaning
Discord authentication failed Bot token is invalid. Regenerate from the Developer Portal.
Discord bot lacks permission Bot is missing required permissions in the channel.
Discord resource not found (404) Channel or message doesn't exist. Check IDs.
Discord rate limited Too many requests. The error includes the retry delay.

Limitations#