Make client reply with html formatted text
This commit is contained in:
parent
e8c096108b
commit
ea43984ec6
1 changed files with 4 additions and 1 deletions
|
@ -7,6 +7,7 @@ import {
|
||||||
|
|
||||||
import { config } from "../config.ts";
|
import { config } from "../config.ts";
|
||||||
import { callOpenAiAPI } from "./openai.js";
|
import { callOpenAiAPI } from "./openai.js";
|
||||||
|
import { convertMarkdownToHtml } from "./markdownToHtmlHelper.ts";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
homeserverUrl,
|
homeserverUrl,
|
||||||
|
@ -51,6 +52,8 @@ async function handleCommand(roomId: string, event: Event) {
|
||||||
bearer: openaiApiKey,
|
bearer: openaiApiKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const htmlResponse = convertMarkdownToHtml(responseFromAi);
|
||||||
|
|
||||||
await client.setTyping(roomId, false);
|
await client.setTyping(roomId, false);
|
||||||
await client.replyNotice(roomId, event, responseFromAi);
|
await client.sendHtmlText(roomId, htmlResponse);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue