Problem
When receiving a merge_forward (合并转发) message containing interactive cards, the card content is displayed as [interactive] instead of being parsed.
Current behavior:
[Merged and Forwarded Messages]
- 希,你会写小说不?
- [interactive]
- 希,想让你写一个关于......我们的故事,老样子,飞书文档
- [interactive]
- [interactive]
Expected behavior:
Interactive cards should be parsed to extract readable content (title, text elements, etc.)
Root Cause
In extensions/feishu/src/bot.ts, the renderSubMessageContent() function handles various message types but falls through to the default case for interactive:
default:
return `[${contentType}]`; // line ~434
Proposed Solution
Add a case for interactive message type to extract:
- Card title (if present)
- Text elements from the card structure
- Button labels or other actionable elements
Example implementation:
case "interactive":
try {
const card = JSON.parse(parsed);
const title = card.header?.title?.content || "";
const elements = card.elements || [];
const texts = elements
.filter((e: any) => e.tag === "div" || e.tag === "markdown")
.map((e: any) => e.text?.content || e.content || "")
.filter(Boolean);
return title ? `[Card: ${title}] ${texts.join(" ")}` : `[Card] ${texts.join(" ")}`;
} catch {
return "[Interactive Card]";
}
Related
Problem
When receiving a
merge_forward(合并转发) message containing interactive cards, the card content is displayed as[interactive]instead of being parsed.Current behavior:
Expected behavior:
Interactive cards should be parsed to extract readable content (title, text elements, etc.)
Root Cause
In
extensions/feishu/src/bot.ts, therenderSubMessageContent()function handles various message types but falls through to the default case forinteractive:Proposed Solution
Add a case for
interactivemessage type to extract:Example implementation:
Related