Adding param for webhook bot name

Adding param for webhook bot name
This commit is contained in:
Felix Heal 2019-04-04 23:08:06 +01:00 committed by GitHub
parent 273e5c43b7
commit b3839754d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,10 @@ while (( "$#" )); do
message="$2" message="$2"
shift 2 shift 2
;; ;;
-b|--botname)
botname="$2"
shift 2
;;
--) --)
shift shift
break break
@ -34,5 +38,6 @@ while (( "$#" )); do
done done
url="https://discordapp.com/api/webhooks/URL" url="https://discordapp.com/api/webhooks/URL"
curl -H "Content-Tyep: application/json" -X POST -d '{"content": "'$mention' '$message'"}' $url curl -H "Content-Tyep: application/json" -X POST -d '{"username": "'$botname'", "content": "'$mention' '$message'"}' $url
echo "" echo ""