1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-04 11:51:45 +03:00

Add /spoiler command

As a temporary measure until we have an extensible Markdown parser.

Signed-off-by: Robin Townsend <robin@robin.town>
This commit is contained in:
Robin Townsend
2021-02-25 16:59:27 -05:00
parent cf0f591cba
commit f1fabd831c
2 changed files with 13 additions and 0 deletions

View File

@@ -154,6 +154,18 @@ function success(promise?: Promise<any>) {
*/
export const Commands = [
new Command({
command: 'spoiler',
args: '<message>',
description: _td('Sends the given message as a spoiler'),
runFn: function(roomId, message) {
return success(MatrixClientPeg.get().sendHtmlMessage(
roomId, message,
`<span data-mx-spoiler>${message}</span>`,
));
},
category: CommandCategories.messages,
}),
new Command({
command: 'shrug',
args: '<message>',