惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
I
InfoQ
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
量子位
博客园 - 叶小钗
月光博客
月光博客
IT之家
IT之家
G
Google Developers Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
小众软件
小众软件
S
SegmentFault 最新的问题
Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
feat(telegram): send rich messages as rich html (#93286) ...
obviyus · 2026-06-15 · via Recent Commits to openclaw:main

@@ -33,7 +33,11 @@ import { resolveTelegramInlineButtons, type TelegramInlineButtons } from "../but

3333

import { splitTelegramCaption } from "../caption.js";

3434

import { renderTelegramHtmlText } from "../format.js";

3535

import { resolveTelegramInteractiveTextFallback } from "../interactive-fallback.js";

36-

import { splitTelegramRichMarkdownChunks, TELEGRAM_RICH_TEXT_LIMIT } from "../rich-message.js";

36+

import {

37+

splitTelegramRichMessageTextChunks,

38+

TELEGRAM_RICH_TEXT_LIMIT,

39+

type TelegramRichTextChunk,

40+

} from "../rich-message.js";

3741

import { buildInlineKeyboard } from "../send.js";

3842

import { resolveTelegramVoiceSend } from "../voice.js";

3943

import {

@@ -71,23 +75,23 @@ type TelegramReplyQuoteForSend = {

7175

entities?: unknown[];

7276

};

737774-

type TelegramTextChunk = {

75-

text: string;

76-

};

77-78-

type ChunkTextFn = (markdown: string) => TelegramTextChunk[];

78+

type ChunkTextFn = (markdown: string) => TelegramRichTextChunk[];

79798080

function buildChunkTextResolver(params: {

8181

textLimit: number;

8282

chunkMode: ChunkMode;

8383

tableMode?: MarkdownTableMode;

84+

skipEntityDetection?: boolean;

8485

}): ChunkTextFn {

8586

return (markdown: string) => {

86-

return splitTelegramRichMarkdownChunks(markdown, params.textLimit, params.chunkMode).map(

87-

(text) => ({

88-

text,

89-

}),

90-

);

87+

return splitTelegramRichMessageTextChunks({

88+

text: markdown,

89+

textLimit: params.textLimit,

90+

textMode: "markdown",

91+

chunkMode: params.chunkMode,

92+

tableMode: params.tableMode,

93+

skipEntityDetection: params.skipEntityDetection,

94+

});

9195

};

9296

}

9397

@@ -156,6 +160,7 @@ async function deliverTextReply(params: {

156160

replyQuoteEntities?: unknown[];

157161

linkPreview?: boolean;

158162

silent?: boolean;

163+

tableMode?: MarkdownTableMode;

159164

replyToId?: number;

160165

replyToMode: ReplyToMode;

161166

progress: DeliveryProgress;

@@ -183,8 +188,9 @@ async function deliverTextReply(params: {

183188

replyQuotePosition: params.replyQuotePosition,

184189

replyQuoteEntities: params.replyQuoteEntities,

185190

thread: params.thread,

186-

textMode: "markdown",

191+

textMode: chunk.textMode,

187192

linkPreview: params.linkPreview,

193+

tableMode: params.tableMode,

188194

silent: params.silent,

189195

replyMarkup,

190196

},

@@ -207,6 +213,7 @@ async function sendPendingFollowUpText(params: {

207213

replyMarkup?: ReturnType<typeof buildInlineKeyboard>;

208214

linkPreview?: boolean;

209215

silent?: boolean;

216+

tableMode?: MarkdownTableMode;

210217

replyToId?: number;

211218

replyToMode: ReplyToMode;

212219

progress: DeliveryProgress;

@@ -223,8 +230,9 @@ async function sendPendingFollowUpText(params: {

223230

await sendTelegramText(params.bot, params.chatId, chunk.text, params.runtime, {

224231

replyToMessageId,

225232

thread: params.thread,

226-

textMode: "markdown",

233+

textMode: chunk.textMode,

227234

linkPreview: params.linkPreview,

235+

tableMode: params.tableMode,

228236

silent: params.silent,

229237

replyMarkup,

230238

});

@@ -261,14 +269,15 @@ async function sendTelegramVoiceFallbackText(opts: {

261269

chatId: string;

262270

runtime: RuntimeEnv;

263271

text: string;

264-

chunkText: (markdown: string) => TelegramTextChunk[];

272+

chunkText: ChunkTextFn;

265273

replyToId?: number;

266274

replyQuoteMessageId?: number;

267275

replyQuotePosition?: number;

268276

replyQuoteEntities?: unknown[];

269277

thread?: TelegramThreadSpec | null;

270278

linkPreview?: boolean;

271279

silent?: boolean;

280+

tableMode?: MarkdownTableMode;

272281

replyMarkup?: ReturnType<typeof buildInlineKeyboard>;

273282

replyQuoteText?: string;

274283

}): Promise<number | undefined> {

@@ -286,8 +295,9 @@ async function sendTelegramVoiceFallbackText(opts: {

286295

replyQuotePosition: applyQuoteForChunk ? opts.replyQuotePosition : undefined,

287296

replyQuoteEntities: applyQuoteForChunk ? opts.replyQuoteEntities : undefined,

288297

thread: opts.thread,

289-

textMode: "markdown",

298+

textMode: chunk.textMode,

290299

linkPreview: opts.linkPreview,

300+

tableMode: opts.tableMode,

291301

silent: opts.silent,

292302

replyMarkup: !appliedReplyTo ? opts.replyMarkup : undefined,

293303

});

@@ -552,6 +562,7 @@ async function deliverMediaReply(params: {

552562

replyMarkup: params.replyMarkup,

553563

linkPreview: params.linkPreview,

554564

silent: params.silent,

565+

tableMode: params.tableMode,

555566

replyToId: params.replyToId,

556567

replyToMode: params.replyToMode,

557568

progress: params.progress,

@@ -717,6 +728,7 @@ export async function deliverReplies(params: {

717728

textLimit: Math.min(params.textLimit, TELEGRAM_RICH_TEXT_LIMIT),

718729

chunkMode: params.chunkMode ?? "length",

719730

tableMode: params.tableMode,

731+

skipEntityDetection: params.linkPreview === false,

720732

});

721733

const candidateReplies: ReplyPayload[] = [];

722734

for (const reply of params.replies) {

@@ -837,6 +849,7 @@ export async function deliverReplies(params: {

837849

replyQuoteEntities: replyQuote.entities,

838850

linkPreview: params.linkPreview,

839851

silent: params.silent,

852+

tableMode: params.tableMode,

840853

replyToId,

841854

replyToMode: params.replyToMode,

842855

progress,