-
Notifications
You must be signed in to change notification settings - Fork 16
[Feature Request] Reply to messages #7
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
Comments
there isn't an example, but you can easily send replies by just following the spec of a reply. You can generate an example by sending what you want in a client and then inspecting the message json. E.g. this is a very generic template for a media event that is a reply at the same time. replymedia:
type: m.room.message
variables:
react_to_event: '{{event.content.get_reply_to() or event.event_id}}'
content:
msgtype: $${type}
body: $${description}
url: $${media}
info:
mimetype: $${mime}
w: $${width}
h: $${height}}
size: $${size}
m.relates_to:
rel_type: m.reply
m.in_reply_to:
event_id: $${react_to_event} |
Possible,
|
I am currently using these 4 templates: reply:
type: m.room.message
variables:
react_to_event: '{{event.content.get_edit() or event.event_id}}'
content:
msgtype: $${type}
body: $${body}
m.relates_to:
rel_type: m.reply
m.in_reply_to:
event_id: $${react_to_event}
replyhtml:
type: m.room.message
variables:
react_to_event: '{{event.content.get_edit() or event.event_id}}'
content:
msgtype: $${type}
body: $${body}
format: org.matrix.custom.html
formatted_body: $${formattedbody}
m.relates_to:
rel_type: m.reply
m.in_reply_to:
event_id: $${react_to_event}
replymedia:
type: m.room.message
variables:
react_to_event: '{{event.content.get_edit() or event.event_id}}'
content:
msgtype: $${type}
body: $${description}
url: $${media}
info:
mimetype: $${mime}
w: $${width}
h: $${height}
size: $${size}
m.relates_to:
rel_type: m.reply
m.in_reply_to:
event_id: $${react_to_event}
replysticker:
type: m.sticker
variables:
react_to_event: '{{event.content.get_edit() or event.event_id}}'
content:
url: $${sticker}
info:
w: $${width}
h: $${height}
size: $${size}
mimetype: $${mime}
body: $${description}
m.relates_to:
rel_type: m.reply
m.in_reply_to:
event_id: $${react_to_event} I suppose with some jinja magic that detects what values are set and switches based on that it might even be possible to merge them. Please note especially that I have changed - react_to_event: '{{event.content.get_reply_to() or event.event_id}}'
+ react_to_event: '{{event.content.get_edit() or event.event_id}}' The old version is based on the current templates, but in case the reaction gets triggered by a reply, then maubot will also react/reply to the original message instead of the message that triggered it. It would also not work great with edited messages. The updated version fixes both of those issues. If extensible events are coming along shortly, all these schemes will need some updates. |
Reactions are nice, but it would be great to have a way to reply by quoting original matched user message, as well as an example illustrating it.
The text was updated successfully, but these errors were encountered: