53 lines
966 B
Python
53 lines
966 B
Python
import os
|
|
|
|
name = "Synapse Message Push"
|
|
|
|
kind = "action"
|
|
|
|
showstatus = True
|
|
|
|
resolve = {
|
|
"sender": ["messages", 0, "senderId"],
|
|
"message_id": ["messages", 0, "id"],
|
|
#"username": ["profile", "username"],
|
|
"message_body": ["messages", 0, "text"],
|
|
"room_id": ["dmroom_id"],
|
|
#"location": ["profile", "location"],
|
|
}
|
|
keys = [
|
|
{
|
|
"keytitle": "msgtype",
|
|
"keyvalue": "m.text",
|
|
},
|
|
{
|
|
"keytitle": "body",
|
|
"keyvalue": {
|
|
"resolved": "message_body",
|
|
},
|
|
},
|
|
]
|
|
|
|
method = "PUT"
|
|
|
|
path = [
|
|
"https://loxthelion.com/_matrix/client/v3/rooms/",
|
|
{"resolved": "room_id"},
|
|
"/send/m.room.message/",
|
|
{"resolved": "message_id"},
|
|
"?user_id=@rmass_",
|
|
{"resolved": "sender"},
|
|
":loxthelion.com",
|
|
]
|
|
|
|
headers = {
|
|
"Authorization": {
|
|
"os": "AS_TOKEN",
|
|
"prefix": "Bearer ",
|
|
},
|
|
"Content-Type": "application/json",
|
|
}
|
|
|
|
#outputs = {
|
|
# "room_id": "room_id",
|
|
#}
|