mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Add help slash command
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
7f2fdd4315
commit
d2e2c4edb6
@ -809,6 +809,38 @@ export const CommandMap = {
|
||||
return success(MatrixClientPeg.get().sendHtmlEmote(roomId, args, textToHtmlRainbow(args)));
|
||||
},
|
||||
}),
|
||||
|
||||
help: new Command({
|
||||
name: "help",
|
||||
description: _td("Displays list of commands with usages and descriptions"),
|
||||
runFn: function() {
|
||||
const InfoDialog = sdk.getComponent('dialogs.InfoDialog');
|
||||
Modal.createTrackedDialog('Slash Commands', 'Help', InfoDialog, {
|
||||
title: _t("Command Help"),
|
||||
description: <table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{_t("Command")}</td>
|
||||
<td>{_t("Arguments")}</td>
|
||||
<td>{_t("Description")}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{
|
||||
Object.values(CommandMap).map(cmd => {
|
||||
return <tr key={cmd.command}>
|
||||
<td>{cmd.command}</td>
|
||||
<td>{cmd.args}</td>
|
||||
<td>{cmd.description}</td>
|
||||
</tr>;
|
||||
})
|
||||
}
|
||||
</tbody>
|
||||
</table>,
|
||||
});
|
||||
return success();
|
||||
},
|
||||
}),
|
||||
};
|
||||
/* eslint-enable babel/no-invalid-this */
|
||||
|
||||
|
@ -182,6 +182,10 @@
|
||||
"Forces the current outbound group session in an encrypted room to be discarded": "Forces the current outbound group session in an encrypted room to be discarded",
|
||||
"Sends the given message coloured as a rainbow": "Sends the given message coloured as a rainbow",
|
||||
"Sends the given emote coloured as a rainbow": "Sends the given emote coloured as a rainbow",
|
||||
"Displays list of commands with usages and descriptions": "Displays list of commands with usages and descriptions",
|
||||
"Command Help": "Command Help",
|
||||
"Command": "Command",
|
||||
"Arguments": "Arguments",
|
||||
"Unrecognised command:": "Unrecognised command:",
|
||||
"Reason": "Reason",
|
||||
"%(targetName)s accepted the invitation for %(displayName)s.": "%(targetName)s accepted the invitation for %(displayName)s.",
|
||||
|
Loading…
Reference in New Issue
Block a user