From b4e605db2b4f1cc0247feb0ca249c4f459909ac4 Mon Sep 17 00:00:00 2001 From: Mitch Weaver Date: Fri, 8 Dec 2023 15:22:04 -0600 Subject: [PATCH] initial --- webhook.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 webhook.sh diff --git a/webhook.sh b/webhook.sh new file mode 100755 index 0000000..5f28c7c --- /dev/null +++ b/webhook.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# discord webhook message example + +webhook_url="https://discord.com/api/webhooks/1176483934008262749/F2fav42fOyucZcgf-0z9o7iY9AkCPCNBfhazdeUU-9Ycc7jnhO7l12xS-F7idbK60xtz" + +msg() { + message="$(printf '%s' "$*" | jq -Rsa .)" + + curl -s \ + -X POST "$webhook_url" \ + -H "Content-Type:application/json" \ + --data "{\"content\": $message}" +} + +msg "$@"