Skip to content

Instantly share code, notes, and snippets.

@travnewmatic
Last active February 2, 2024 19:32
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save travnewmatic/769cd9532504e0f85983d69acd4a7d29 to your computer and use it in GitHub Desktop.
Save travnewmatic/769cd9532504e0f85983d69acd4a7d29 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Adjust homserver, room, and accesstoken to your particular setup
# Script is expecting data to be piped in on STDIN
# Example:
# echo "some text" | sendmatrix
msgtype=m.text
homeserver=<homeserver>
room=<room id>
accesstoken=<access token>
curl -XPOST -d "$( jq -Rsc --arg msgtype "$msgtype" '{$msgtype, body:.}')" "https://$homeserver/_matrix/client/r0/rooms/$room/send/m.room.message?access_token=$accesstoken"
@jasalt
Copy link

jasalt commented Jul 16, 2020

Any way to send a video or an image?

Maybe see here:

https://matrix.org/docs/api/client-server/#!/Media/uploadContent

@CastilloLuis
Copy link

how can we quote a message from other user? basically how to reply to a message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment