Skip to content

Instantly share code, notes, and snippets.

@travnewmatic travnewmatic/sendmatrix

Last active Nov 6, 2018
What would you like to do?
# substitute with your variables
# grabs all arguments and dumps them into the body of the message
HOMESERVER=<homeserver goes here>
ROOM=<room id goes here>
ACCESSTOKEN=<access token goes here>
JSON=$( jq -n \
--arg msgtype "$MSGTYPE" \
--arg body "$BODY"\
'{msgtype: $msgtype, body: $body}' )
/usr/bin/curl -XPOST -d "$JSON" "https://$HOMESERVER/_matrix/client/r0/rooms/$ROOM/send/$ACCESSTOKEN"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.