You've already forked element-web
mirror of
https://github.com/element-hq/element-web.git
synced 2025-12-01 09:58:03 +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:
@@ -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>',
|
||||
|
||||
Reference in New Issue
Block a user