Discord_webhook/webhook.sh
2025-02-11 11:52:04 +01:00

20 lines
389 B
Bash

#!/bin/bash
WEBHOOK='https://discord.com/api/webhooks/1338109049413308526/YOURWEBHOOKHEREDARLING'
begin="Command result:
\`\`\`
"
ending="
\`\`\`
<@YOURUSERIDHERE>
-# Sent from $(hostname) @ $(date)"
#Read from pipe
while read content;
do
MSG=$(jq -n -r --arg msg "$begin$content$ending" '{content: $msg}')
done
curl -X POST -H "Content-Type: application/json" --data "$MSG" $WEBHOOK