This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
Add hint buttons to messages (like Telegram does) #2109
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add feature to show buttons with predefined reply action. Similar like it does Telegram messanger. Useful for making hints for available bot commands. Buttons rendering to the bottom of the message combining in two to five buttons in a row.
To make it work message content must be extended by hints list. Each element of a list contain object describing button. Button content could be simple text or formatted html like in ordinary messages. Also it is possible ad image or just place only image.
Pushing button send message to the room with (by default) text of button, but could be set to predefined text by "reply" attribute. Message type for sendback by default is m.text. It is possible to send m.notice type by setting "replynotify" attribute to true.
Sample message content without buttons:
Sample message content with two buttons:
Available attributes in hint objects are:
body - simple text
reply - text to send back
formatted_body - html formatted text
format - formated body type. For now just only "org.matrix.custom.html" to make it look like ordinary body content.
img - internal mx url for image. Could be also external image or base64 encoded data url.
replynotify - boolean, if set to true then message type to send back is m.notice. Useful for "hiding" reply message.