refactor: unify markdown formatting pipeline
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { chunkMarkdownText } from "../../../auto-reply/chunk.js";
|
||||
import { markdownToTelegramHtmlChunks } from "../../../telegram/format.js";
|
||||
import { sendMessageTelegram } from "../../../telegram/send.js";
|
||||
import type { ChannelOutboundAdapter } from "../types.js";
|
||||
|
||||
@@ -10,7 +10,7 @@ function parseReplyToMessageId(replyToId?: string | null) {
|
||||
|
||||
export const telegramOutbound: ChannelOutboundAdapter = {
|
||||
deliveryMode: "direct",
|
||||
chunker: chunkMarkdownText,
|
||||
chunker: markdownToTelegramHtmlChunks,
|
||||
textChunkLimit: 4000,
|
||||
resolveTarget: ({ to }) => {
|
||||
const trimmed = to?.trim();
|
||||
@@ -27,6 +27,7 @@ export const telegramOutbound: ChannelOutboundAdapter = {
|
||||
const replyToMessageId = parseReplyToMessageId(replyToId);
|
||||
const result = await send(to, text, {
|
||||
verbose: false,
|
||||
textMode: "html",
|
||||
messageThreadId: threadId ?? undefined,
|
||||
replyToMessageId,
|
||||
accountId: accountId ?? undefined,
|
||||
@@ -39,6 +40,7 @@ export const telegramOutbound: ChannelOutboundAdapter = {
|
||||
const result = await send(to, text, {
|
||||
verbose: false,
|
||||
mediaUrl,
|
||||
textMode: "html",
|
||||
messageThreadId: threadId ?? undefined,
|
||||
replyToMessageId,
|
||||
accountId: accountId ?? undefined,
|
||||
|
||||
Reference in New Issue
Block a user