feat(onebot): include text alongside received markdown

Preserve Markdown messages while making their content available to integrations that read text segments.

Fixes #474
This commit is contained in:
DrSmoothl committed 2026-09-26 15:57:28 +08:00
1 parent 726fbc6c67
commit 1934e4e7f7
2 files changed
+28

No files matched your search

@@ -36,6 +36,9 @@ export async function elementsToOneBotSegments(
// breadcrumb) and keep converting the rest.
try {
result.push(await elementToSegment(element, segmentCtx));
if (element.type === 'markdown' && element.text) {
result.push({ type: 'text', data: { text: element.text } });
}
} catch (err) {
log.warn('segment convert skipped type=%s (%s)', element.type,
err instanceof Error ? err.message : String(err));