Discord message sender.

This commit is contained in:
thomaspcole 2019-04-04 16:54:08 -04:00
parent cf1d06bc0d
commit 273e5c43b7

38
discordBot.sh Executable file
View File

@ -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 ""