Add support for /html

This commit is contained in:
RGBCube 2025-10-29 02:42:29 +03:00
parent 504eee3713
commit fac4a3ce5b
No known key found for this signature in database
2 changed files with 8 additions and 0 deletions

View file

@ -326,6 +326,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
plainText = rainbow(plainText); plainText = rainbow(plainText);
customHtml = rainbow(customHtml); customHtml = rainbow(customHtml);
msgType = MsgType.Emote; msgType = MsgType.Emote;
} else if (commandName === Command.Html) {
customHtml = plainText;
} else if (commandName === Command.Shrug) { } else if (commandName === Command.Shrug) {
plainText = `${SHRUG} ${plainText}`; plainText = `${SHRUG} ${plainText}`;
customHtml = `${SHRUG} ${customHtml}`; customHtml = `${SHRUG} ${customHtml}`;

View file

@ -142,6 +142,7 @@ export enum Command {
Notice = 'notice', Notice = 'notice',
Rainbow = 'rainbow', Rainbow = 'rainbow',
RainbowMe = 'rainbowme', RainbowMe = 'rainbowme',
Html = 'html',
Shrug = 'shrug', Shrug = 'shrug',
StartDm = 'startdm', StartDm = 'startdm',
Join = 'join', Join = 'join',
@ -196,6 +197,11 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => {
description: 'Send rainbow action message', description: 'Send rainbow action message',
exe: async () => undefined, exe: async () => undefined,
}, },
[Command.Html]: {
name: Command.Html,
description: 'Send raw HTML message',
exe: async () => undefined,
},
[Command.Shrug]: { [Command.Shrug]: {
name: Command.Shrug, name: Command.Shrug,
description: 'Send ¯\\_(ツ)_/¯ as message', description: 'Send ¯\\_(ツ)_/¯ as message',