From ea43984ec6fd91c0b3931ee5232b118d3a1b754f Mon Sep 17 00:00:00 2001 From: Nikhil Nawgiri Date: Tue, 27 Aug 2024 16:50:46 +0200 Subject: [PATCH] Make client reply with html formatted text --- src/main.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index d1a594a..eaba68e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,6 +7,7 @@ import { import { config } from "../config.ts"; import { callOpenAiAPI } from "./openai.js"; +import { convertMarkdownToHtml } from "./markdownToHtmlHelper.ts"; const { homeserverUrl, @@ -51,6 +52,8 @@ async function handleCommand(roomId: string, event: Event) { bearer: openaiApiKey, }); + const htmlResponse = convertMarkdownToHtml(responseFromAi); + await client.setTyping(roomId, false); - await client.replyNotice(roomId, event, responseFromAi); + await client.sendHtmlText(roomId, htmlResponse); }