From fac4a3ce5b5ad68c89b2c06d60bb238b4ea75b83 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Wed, 29 Oct 2025 02:42:29 +0300 Subject: [PATCH] Add support for /html --- src/app/features/room/RoomInput.tsx | 2 ++ src/app/hooks/useCommands.ts | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/app/features/room/RoomInput.tsx b/src/app/features/room/RoomInput.tsx index 5a5a5b80..de389643 100644 --- a/src/app/features/room/RoomInput.tsx +++ b/src/app/features/room/RoomInput.tsx @@ -326,6 +326,8 @@ export const RoomInput = forwardRef( plainText = rainbow(plainText); customHtml = rainbow(customHtml); msgType = MsgType.Emote; + } else if (commandName === Command.Html) { + customHtml = plainText; } else if (commandName === Command.Shrug) { plainText = `${SHRUG} ${plainText}`; customHtml = `${SHRUG} ${customHtml}`; diff --git a/src/app/hooks/useCommands.ts b/src/app/hooks/useCommands.ts index 3fc6b6cb..ce59cbd2 100644 --- a/src/app/hooks/useCommands.ts +++ b/src/app/hooks/useCommands.ts @@ -142,6 +142,7 @@ export enum Command { Notice = 'notice', Rainbow = 'rainbow', RainbowMe = 'rainbowme', + Html = 'html', Shrug = 'shrug', StartDm = 'startdm', Join = 'join', @@ -196,6 +197,11 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { description: 'Send rainbow action message', exe: async () => undefined, }, + [Command.Html]: { + name: Command.Html, + description: 'Send raw HTML message', + exe: async () => undefined, + }, [Command.Shrug]: { name: Command.Shrug, description: 'Send ¯\\_(ツ)_/¯ as message',