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
- In Discord, go to Server Settings → Integrations → Webhooks
- Create a new webhook and copy the URL
- In Dispatch, go to Destinations → Create Destination
- Select Discord as the type and paste the webhook URL
Option 2: OAuth Connection
- Go to Destinations → Connect Discord
- Authorize the Dispatch bot for your server
- Select a channel
- 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:
| Field | Max Length |
|---|---|
| Title | 256 characters |
| Description | 4096 characters |
| Fields | 25 per embed |
| Field name | 256 characters |
| Field value | 1024 characters |
| Footer text | 2048 characters |
| Author name | 256 characters |
Colors
Embed colors are specified as decimal integers. Common values:
| Color | Decimal | Hex |
|---|---|---|
| Red | 16711680 | #FF0000 |
| Green | 65280 | #00FF00 |
| Blue | 255 | #0000FF |
| Orange (Dispatch) | 15105570 | #E67E22 |
| Purple | 10181046 | #9B59B6 |
| Yellow | 16776960 | #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-Afterheader 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
Thread Support
Dispatch can deliver messages to a specific Discord thread rather than the main channel.
Destination-level thread
Set a thread on the destination itself (in Create Destination or Edit Destination). All messages delivered through that destination will be posted to the specified thread.
For destinations connected via OAuth, Dispatch shows a searchable dropdown of all active threads in your server, grouped by channel. Select the thread and the name is saved alongside the ID.
For destinations added by pasting a webhook URL directly, enter the thread ID manually. To find a thread ID in Discord, right-click the thread and select Copy Thread ID (requires Developer Mode to be enabled in Discord settings).
Per-rule thread override
You can also set a thread on individual routing rules. The rule-level thread takes precedence over the destination-level one, so you can route different event types to different threads. The same searchable picker is available in the routing rules dialog for OAuth-connected destinations.
Example:
Default thread: #deployments (all events go here by default)
Routing rule:
body.action = "deploy"
→ Deliver, thread: #production-deploys (deploys go to a separate thread)