Skip to main content

Discord Integration

Discord is the primary destination type in Dispatch. Events are delivered as rich embed messages to Discord channels.

Setting Up a Discord Destination

Option 1: Manual Webhook URL

  1. In Discord, go to Server SettingsIntegrationsWebhooks
  2. Create a new webhook and copy the URL
  3. In Dispatch, go to DestinationsCreate Destination
  4. Select Discord as the type and paste the webhook URL

Option 2: OAuth Connection

  1. Go to DestinationsConnect Discord
  2. Authorize the Dispatch bot for your server
  3. Select a channel
  4. Dispatch creates the webhook automatically

Discord Embed Format

Dispatch delivers events as Discord webhook messages with rich embeds:

{
"content": "",
"username": "Dispatch",
"avatar_url": "",
"embeds": [
{
"title": "push",
"description": "3 commits pushed to main",
"color": 15105570,
"fields": [
{
"name": "Repository",
"value": "owner/repo",
"inline": true
},
{
"name": "Branch",
"value": "main",
"inline": true
}
],
"footer": {
"text": "Dispatch"
},
"timestamp": "2025-03-14T10:30:00Z"
}
]
}

Embed Limits

Discord enforces these limits on embed content:

FieldMax Length
Title256 characters
Description4096 characters
Fields25 per embed
Field name256 characters
Field value1024 characters
Footer text2048 characters
Author name256 characters

Colors

Embed colors are specified as decimal integers. Common values:

ColorDecimalHex
Red16711680#FF0000
Green65280#00FF00
Blue255#0000FF
Orange (Dispatch)15105570#E67E22
Purple10181046#9B59B6
Yellow16776960#FFFF00

ANSI Formatting

Discord supports ANSI color codes in code blocks. Dispatch templates provide helper functions for ANSI formatting:

{{ansiGreen "SUCCESS"}}    → Green text
{{ansiRed "ERROR"}} → Red text
{{ansiYellow "WARNING"}} → Yellow text
{{ansiBold "Important"}} → Bold text

These are rendered inside Discord's ANSI code block syntax (ansi language identifier).

Rate Limiting

Discord enforces rate limits on webhook endpoints. Dispatch handles this automatically:

  • Cooldown — per-destination cooldown period tracked across all delivery workers
  • Retry-After — respects Discord's Retry-After header on 429 responses

If Discord returns a 429, the delivery is automatically retried after the specified cooldown period.

Security

  • Webhook URLs are encrypted at rest
  • URLs are only decrypted at delivery time and are never exposed in API responses or logs