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:
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));
|
||||
|
||||
Reference in new issue
Block a user