Discord message sender.
This commit is contained in:
parent
cf1d06bc0d
commit
273e5c43b7
38
discordBot.sh
Executable file
38
discordBot.sh
Executable 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 ""
|
Loading…
Reference in New Issue
Block a user