feat(feishu): sync community contributions from clawdbot-feishu (#12662)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Yifeng Wang
2026-02-10 08:19:44 +08:00
committed by GitHub
parent 49c60e9065
commit 5c2cb6c591
7 changed files with 437 additions and 85 deletions

View File

@@ -1,6 +1,6 @@
import type { ClawdbotConfig } from "openclaw/plugin-sdk";
import type { MentionTarget } from "./mention.js";
import type { FeishuSendResult } from "./types.js";
import type { FeishuSendResult, ResolvedFeishuAccount } from "./types.js";
import { resolveFeishuAccount } from "./accounts.js";
import { createFeishuClient } from "./client.js";
import { buildMentionedMessage, buildMentionedCardContent } from "./mention.js";
@@ -281,18 +281,22 @@ export async function updateCardFeishu(params: {
/**
* Build a Feishu interactive card with markdown content.
* Cards render markdown properly (code blocks, tables, links, etc.)
* Uses schema 2.0 format for proper markdown rendering.
*/
export function buildMarkdownCard(text: string): Record<string, unknown> {
return {
schema: "2.0",
config: {
wide_screen_mode: true,
},
elements: [
{
tag: "markdown",
content: text,
},
],
body: {
elements: [
{
tag: "markdown",
content: text,
},
],
},
};
}