Skip to content

Instantly share code, notes, and snippets.

@Log1x
Created April 16, 2020 08:24
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Log1x/0c24e25952d039fa7e708d5205cd94f9 to your computer and use it in GitHub Desktop.
Save Log1x/0c24e25952d039fa7e708d5205cd94f9 to your computer and use it in GitHub Desktop.
Discord Notification Webhook for unRAID
#!/bin/bash
# Replace Slack.sh in /boot/config/plugins/dynamix/notifications/agents
# Set to your Discord webhook token.
WEBHOOK="https://discordapp.com/api/webhooks/ID/TOKEN"
curl "$WEBHOOK" \
-X "POST" \
-H 'Content-Type: application/json' \
--data @<(cat <<EOF
{
"embeds": [
{
"title": "$EVENT",
"description": "$SUBJECT",
"footer": {
"text": "$(date) on $(hostname)"
},
"thumbnail": {
"url": "https://i.imgur.com/tlooVc1.png",
"height": 16,
"width": 16
},
"fields": [
{
"name": "Priority",
"value": "${IMPORTANCE^}"
},
{
"name": "Description",
"value": "$DESCRIPTION\n\n$CONTENT"
}
]
}
]
}
EOF
)
@Log1x
Copy link
Author

Log1x commented Apr 16, 2020

Screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment