Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 6612028

Browse files
authored
Merge pull request #5696 from robintown/spoiler-command
Add /spoiler command
2 parents dfd6551 + 8a709b3 commit 6612028

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/SlashCommands.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,18 @@ function success(promise?: Promise<any>) {
155155
*/
156156

157157
export const Commands = [
158+
new Command({
159+
command: 'spoiler',
160+
args: '<message>',
161+
description: _td('Sends the given message as a spoiler'),
162+
runFn: function(roomId, message) {
163+
return success(ContentHelpers.makeHtmlMessage(
164+
message,
165+
`<span data-mx-spoiler>${message}</span>`,
166+
));
167+
},
168+
category: CommandCategories.messages,
169+
}),
158170
new Command({
159171
command: 'shrug',
160172
args: '<message>',

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@
417417
"Other": "Other",
418418
"Command error": "Command error",
419419
"Usage": "Usage",
420+
"Sends the given message as a spoiler": "Sends the given message as a spoiler",
420421
"Prepends ¯\\_(ツ)_/¯ to a plain-text message": "Prepends ¯\\_(ツ)_/¯ to a plain-text message",
421422
"Prepends (╯°□°)╯︵ ┻━┻ to a plain-text message": "Prepends (╯°□°)╯︵ ┻━┻ to a plain-text message",
422423
"Prepends ┬──┬ ノ( ゜-゜ノ) to a plain-text message": "Prepends ┬──┬ ノ( ゜-゜ノ) to a plain-text message",

0 commit comments

Comments
 (0)