Skip to content

Instantly share code, notes, and snippets.

@cjmaxik
Last active November 5, 2025 20:55
Show Gist options
  • Select an option

  • Save cjmaxik/3044a7c84ee6a5d6b36821d55e7eb3ba to your computer and use it in GitHub Desktop.

Select an option

Save cjmaxik/3044a7c84ee6a5d6b36821d55e7eb3ba to your computer and use it in GitHub Desktop.

Revisions

  1. cjmaxik revised this gist Jul 26, 2025. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions webhook.md
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,8 @@
    "content": "",
    "embeds": [
    {
    "description": "{{ escape message }}",
    "color": 14839040,
    "description": "",
    "fields": [
    {
    "name": "Severity",
    @@ -38,7 +39,7 @@
    "value": "<t:{{ timestamp }}>"
    }
    ],
    "title": "{{ title }}"{{ #if fields.hostname }},
    "title": "{{ escape title }}"{{ #if fields.hostname }},
    "author": {
    "name": "{{ escape fields.hostname }}"
    }{{ /if }}
  2. cjmaxik revised this gist Jul 26, 2025. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions webhook.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,7 @@
    # Proxmox - Discord notifications via Webhook
    > [!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).
    <img width="739" height="445" alt="image" src="https://gist.github.com/user-attachments/assets/9b3cdea7-cd08-46ee-a0a2-5d53c3b2b7fb" />

  3. cjmaxik revised this gist Jul 26, 2025. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions webhook.md
    Original file line number Diff line number Diff line change
    @@ -13,32 +13,32 @@
    "content": "",
    "embeds": [
    {
    "description": "{{ escape message }}",
    "fields": [
    {
    "name": "Severity",
    "value": "{{ severity }}",
    "value": "{{ escape severity }}",
    "inline": true
    }{{ #if fields.type }},
    {
    "name": "Type",
    "value": "{{ fields.type }}",
    "value": "{{ escape fields.type }}",
    "inline": true
    }{{ /if }}{{ #if fields.job-id }},
    {
    "name": "Job ID",
    "value": "{{ fileds.job-id }}",
    "value": "{{ escape fields.job-id }}",
    "inline": true
    }{{ /if }},
    {
    "name": "Timestamp",
    "value": "<t:{{ timestamp }}>"
    }
    ],
    "description": "{{ escape message }}",
    "title": "{{ title }}",
    "title": "{{ title }}"{{ #if fields.hostname }},
    "author": {
    "name": "{{ fields.hostname }}"
    }
    "name": "{{ escape fields.hostname }}"
    }{{ /if }}
    }
    ],
    "username": "Proxmox",
  4. cjmaxik created this gist Jul 26, 2025.
    51 changes: 51 additions & 0 deletions webhook.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@
    # Proxmox - Discord notifications via Webhook

    <img width="739" height="445" alt="image" src="https://gist.github.com/user-attachments/assets/9b3cdea7-cd08-46ee-a0a2-5d53c3b2b7fb" />

    1. Add Notification Target
    - Endpoint name: `Discord`
    - Method: `POST`
    - URL: `https://discord.com/api/webhooks/{{ secrets.token }}`
    - Headers: `Content-Type: application/json`
    - Body:
    ```json
    {
    "content": "",
    "embeds": [
    {
    "fields": [
    {
    "name": "Severity",
    "value": "{{ severity }}",
    "inline": true
    }{{ #if fields.type }},
    {
    "name": "Type",
    "value": "{{ fields.type }}",
    "inline": true
    }{{ /if }}{{ #if fields.job-id }},
    {
    "name": "Job ID",
    "value": "{{ fileds.job-id }}",
    "inline": true
    }{{ /if }},
    {
    "name": "Timestamp",
    "value": "<t:{{ timestamp }}>"
    }
    ],
    "description": "{{ escape message }}",
    "title": "{{ title }}",
    "author": {
    "name": "{{ fields.hostname }}"
    }
    }
    ],
    "username": "Proxmox",
    "avatar_url": "https://www.proxmox.com/apple-touch-icon.png"
    }
    ```
    - Token: `<everything after webhooks/ in the URL>`
    - Comment: `Send notifications to Discord`

    2. Add Discord to Notification Matcher