Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Matrix #105

Open
matthiasbeyer opened this issue Jul 21, 2019 · 4 comments
Open

Support Matrix #105

matthiasbeyer opened this issue Jul 21, 2019 · 4 comments

Comments

@matthiasbeyer
Copy link

Hi,

nobody seemd to mention Matrix support. Would be nice to have that!

@variadico
Copy link
Owner

Sounds great. Can someone help with the implementation?

@variadico variadico added this to the 3.3.0 milestone Jul 22, 2019
@variadico variadico removed this from the 3.3.0 milestone Sep 1, 2019
@dawidd6
Copy link
Contributor

dawidd6 commented Sep 15, 2019

Could use this lib: https://github.com/matrix-org/gomatrix

@peterhoeg
Copy link

I don't think an external library is needed. Use the pushover service as a basis/inspiration and it wouldn't require a lot of work.

@c33s
Copy link

c33s commented Mar 2, 2021

recently i noticed that sending a message to matrix (not e2e) is as simple as a curl call. here are my findings, maybe they help:

one time setup

pre-setup done by the user

from my point of view this is the part the user should do by itself.

get an access token

curl -XPOST -d '{"type":"m.login.password", "user":"username", "password":"password"}' "https://matrix.org/_matrix/client/r0/login"

get room id

  • (create the room)
  • from room settings > advanced. called internal room ID looking like that !xxxxxxxxxxxx:matrix.org

sending a message

access_token=YOURACCESSTOKEN
# $message_id is to prevent sending duplicate messages in a certain timeframe (i think it is 24h). you don't have to provide it but it makes sense.
message_id=YOURMESSAGEID

# jo produces a json from bash variables
message_json_data=$(jo -p msgtype="m.text" body="my message - aka hello world") 

full_matrix_url="https://matrix.org/_matrix/client/r0/rooms/$room_id/send/m.room.message/$message_id?access_token=$access_token"
curl --silent -X PUT -H "Content-Type: application/json" -d "$message_json_data" $full_matrix_url

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

No branches or pull requests

5 participants