Post-group-me.bash

From Pabut
Revision as of 11:02, 3 September 2021 by Pabut (talk | contribs) (Created page with " #!/bin/bash ### # $1 = Event # $2 = BOTID ### if [ "$#" -ne 2 ]; then echo "Illegal number of parameters" echo " $0 <message> <botid>" exit fi G...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
#!/bin/bash
###
# $1 = Event
# $2 = BOTID
###

if [ "$#" -ne 2 ]; then
    echo "Illegal number of parameters"
    echo "     $0 <message> <botid>"
    exit
fi

GROUPME_URL="https://api.groupme.com/v3/bots/post"

MESSAGE="$1"
BOTID="$2"

curl -s -X POST -d "{\"bot_id\": \"$BOTID\", \"text\": \"$MESSAGE\"}" $GROUPME_URL >/dev/null