Note
If you have error 400 when sending the notification, that means that your message is too long, since Discord has a character limit of 2000.
If you don't care about the logs, remove {{ escape message }} from the description field. Otherwise, seek another way to send notifications (i.e. via Cloudflare worker that truncates the description field).
- Add Notification Target
- Endpoint name:
Discord - Method:
POST - URL:
https://discord.com/api/webhooks/{{ secrets.token }} - Headers:
Content-Type: application/json - Body:
{
"content": "",
"embeds": [
{
"color": 14839040,
"description": "",
"fields": [
{
"name": "Severity",
"value": "{{ escape severity }}",
"inline": true
}{{ #if fields.type }},
{
"name": "Type",
"value": "{{ escape fields.type }}",
"inline": true
}{{ /if }}{{ #if fields.job-id }},
{
"name": "Job ID",
"value": "{{ escape fields.job-id }}",
"inline": true
}{{ /if }},
{
"name": "Timestamp",
"value": "<t:{{ timestamp }}>"
}
],
"title": "{{ escape title }}"{{ #if fields.hostname }},
"author": {
"name": "{{ escape fields.hostname }}"
}{{ /if }}
}
],
"username": "Proxmox",
"avatar_url": "https://www.proxmox.com/apple-touch-icon.png"
}- Token:
<everything after webhooks/ in the URL> - Comment:
Send notifications to Discord
- Add Discord to Notification Matcher