From b3839754d15a6b863531053a0ca47e0844d97140 Mon Sep 17 00:00:00 2001 From: Felix Heal Date: Thu, 4 Apr 2019 23:08:06 +0100 Subject: [PATCH] Adding param for webhook bot name Adding param for webhook bot name --- discordBot.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/discordBot.sh b/discordBot.sh index bd89dec..ad20e8e 100755 --- a/discordBot.sh +++ b/discordBot.sh @@ -18,6 +18,10 @@ while (( "$#" )); do message="$2" shift 2 ;; + -b|--botname) + botname="$2" + shift 2 + ;; --) shift break @@ -34,5 +38,6 @@ while (( "$#" )); do done 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 "" +