diff --git a/discordBot.sh b/discordBot.sh new file mode 100755 index 0000000..bd89dec --- /dev/null +++ b/discordBot.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +################################################################################ +# A simple script to send a message to a discord server. # +# # +# # +################################################################################ + +PARAMS="" + +while (( "$#" )); do + case "$1" in + -u|--mention) + mention="<@$2>" + shift 2 + ;; + -m|--message) + message="$2" + shift 2 + ;; + --) + shift + break + ;; + -*|--*=) + echo "Error: Unknown Flag $1" >&2 + exit 1 + ;; + *) + PARAMS="$PARAMS $1" + shift + ;; + esac +done + +url="https://discordapp.com/api/webhooks/URL" +curl -H "Content-Tyep: application/json" -X POST -d '{"content": "'$mention' '$message'"}' $url +echo ""