62 lines
1.1 KiB
Python
62 lines
1.1 KiB
Python
#import os
|
|
|
|
name = "Synapse Message Error Notification"
|
|
|
|
kind = "action"
|
|
|
|
alias = "synapsemsgerrnotify"
|
|
|
|
showstatus = True
|
|
|
|
resolve = {
|
|
"get": {
|
|
"sender": ["room_name"],
|
|
"event_id": ["outmessageitem", "event_id"],
|
|
#"message_body": ["messageitem", "text"],
|
|
"room_id": ["outmessageitem", "room_id"],
|
|
#"timestamp": ["messageitem", "createdAt"],
|
|
},
|
|
"deconstruct": {
|
|
"sender" : [
|
|
"#rmass_dm_",
|
|
":loxthelion.com",
|
|
],
|
|
},
|
|
}
|
|
|
|
keys = [
|
|
{
|
|
"keytitle": "msgtype",
|
|
"keyvalue": "m.notify",
|
|
},
|
|
{
|
|
"keytitle": "body",
|
|
"keyvalue": "Message too short. should be more than 5 chars",
|
|
},
|
|
]
|
|
|
|
method = "PUT"
|
|
|
|
path = [
|
|
"https://loxthelion.com/_matrix/client/v3/rooms/",
|
|
{"resolved": "room_id"},
|
|
"/send/m.room.message/",
|
|
{"resolved": "event_id"},
|
|
"?user_id=@rmass_",
|
|
{"resolved": "sender"},
|
|
":loxthelion.com"
|
|
#"&ts=",
|
|
#{"resolved": "timestamp"},
|
|
#"000"
|
|
]
|
|
|
|
headers = {
|
|
"Authorization": {
|
|
"os": "AS_TOKEN",
|
|
"prefix": "Bearer ",
|
|
},
|
|
"Content-Type": "application/json",
|
|
}
|
|
|
|
|