From f1fabd831c172b7f2fadd70de91a3aa7358b493b Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Thu, 25 Feb 2021 16:59:27 -0500 Subject: [PATCH] Add /spoiler command As a temporary measure until we have an extensible Markdown parser. Signed-off-by: Robin Townsend --- src/SlashCommands.tsx | 12 ++++++++++++ src/i18n/strings/en_EN.json | 1 + 2 files changed, 13 insertions(+) diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index 6b5f261374..7699cc3c25 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -154,6 +154,18 @@ function success(promise?: Promise) { */ export const Commands = [ + new Command({ + command: 'spoiler', + args: '', + description: _td('Sends the given message as a spoiler'), + runFn: function(roomId, message) { + return success(MatrixClientPeg.get().sendHtmlMessage( + roomId, message, + `${message}`, + )); + }, + category: CommandCategories.messages, + }), new Command({ command: 'shrug', args: '', diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 0be7e6e02b..85f03158bd 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -415,6 +415,7 @@ "Other": "Other", "Command error": "Command error", "Usage": "Usage", + "Sends the given message as a spoiler": "Sends the given message as a spoiler", "Prepends ¯\\_(ツ)_/¯ to a plain-text message": "Prepends ¯\\_(ツ)_/¯ to a plain-text message", "Prepends (╯°□°)╯︵ ┻━┻ to a plain-text message": "Prepends (╯°□°)╯︵ ┻━┻ to a plain-text message", "Prepends ┬──┬ ノ( ゜-゜ノ) to a plain-text message": "Prepends ┬──┬ ノ( ゜-゜ノ) to a plain-text message",