diff --git a/discordBot.sh b/discordBot.sh index ad20e8e..7a69845 100755 --- a/discordBot.sh +++ b/discordBot.sh @@ -22,12 +22,29 @@ while (( "$#" )); do botname="$2" shift 2 ;; + -i|--image) + profileImage="$2" + shift 2 + ;; + -h|--help) + echo "Simple Discord Bot help" + echo "Usage: ./discordBot.sh -m MESSAGE" + echo "" + echo "Flags: + -u --mention: Mention a specific user (Userid) + -m --message: The message you wish to send + -b --botname: The name you want the bot to display + -i --image: The profile image you want the bot to display (URL link) + -h --help: Display help information" + exit 1 + ;; --) shift break ;; -*|--*=) echo "Error: Unknown Flag $1" >&2 + echo "Use -h or --help for more information" exit 1 ;; *) @@ -38,6 +55,5 @@ while (( "$#" )); do done url="https://discordapp.com/api/webhooks/URL" -curl -H "Content-Tyep: application/json" -X POST -d '{"username": "'$botname'", "content": "'$mention' '$message'"}' $url +curl -H "Content-Tyep: application/json" -X POST -d '{"username": "'$botname'", "avatar_url": "'$profileImage'", "content": "'$mention' '$message'"}' $url echo "" -