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