Make client reply with html formatted text

This commit is contained in:
Nikhil Nawgiri 2024-08-27 16:50:46 +02:00
parent e8c096108b
commit ea43984ec6

View file

@ -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);
}