Merge pull request #5696 from robintown/spoiler-command

Add /spoiler command
pull/21833/head
J. Ryan Stinnett 2021-03-30 11:58:33 +01:00 committed by GitHub
commit 661202839c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

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

View File

@ -417,6 +417,7 @@
"Other": "Other", "Other": "Other",
"Command error": "Command error", "Command error": "Command error",
"Usage": "Usage", "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", "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",