{
  "schemaVersion": "1.0",
  "item": {
    "slug": "lark-bot",
    "name": "Pywayne Lark Bot",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/wangyendt/lark-bot",
    "canonicalUrl": "https://clawhub.ai/wangyendt/lark-bot",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/lark-bot",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=lark-bot",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/lark-bot"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/lark-bot",
    "agentPageUrl": "https://openagent3.xyz/skills/lark-bot/agent",
    "manifestUrl": "https://openagent3.xyz/skills/lark-bot/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/lark-bot/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Pywayne Lark Bot",
        "body": "飞书机器人模块，提供完整飞书 API 交互功能，包括消息发送、文件管理、用户/群组查询和消息监听。"
      },
      {
        "title": "Quick Start",
        "body": "from pywayne.lark_bot import LarkBot, TextContent\n\n# 初始化\nbot = LarkBot(app_id=\"your_app_id\", app_secret=\"your_app_secret\")\n\n# 发送文本消息到用户\nbot.send_text_to_user(user_open_id=\"user_xxx\", text=\"Hello!\")\n\n# 发送文本消息到群聊\nbot.send_text_to_chat(chat_id=\"oc_xxx\", text=\"Group message\")"
      },
      {
        "title": "TextContent - 文本格式化工具",
        "body": "创建各种文本格式，用于发送带格式的文本消息。"
      },
      {
        "title": "Mentions",
        "body": "# @所有人\nat_all = TextContent.make_at_all_pattern()\n\n# @指定用户\nat_user = TextContent.make_at_someone_pattern(user_open_id=\"user_xxx\", username=\"张三\", id_type=\"open_id\")"
      },
      {
        "title": "Text Styles",
        "body": "# 加粗、斜体、下划线、删除线\nbold = TextContent.make_bold_pattern(\"粗体\")\nitalic = TextContent.make_italian_pattern(\"斜体\")\nunderline = TextContent.make_underline_pattern(\"下划线\")\nstrikethrough = TextContent.make_delete_line_pattern(\"删除线\")\n\n# 超链接\nlink = TextContent.make_url_pattern(\"https://example.com\", \"点击访问\")"
      },
      {
        "title": "推荐路径：发送 Markdown（优先使用）",
        "body": "优先使用 send_markdown_to_chat，它会自动处理大文本分包，并支持两种路由：\n\nprefer=\"card_v2\"（默认）：发送 schema 2.0 interactive 卡片，适合绝大多数 Markdown 场景\nprefer=\"post\"：发送 post 富文本；可设置 table_fallback=\"code_block\" 将 Markdown 表格稳定降级\n\nmd = \"\"\"\n# 发布说明\n\n- 新增对账接口\n- 修复支付重试逻辑\n\n| 模块 | 状态 |\n| --- | --- |\n| API | 完成 |\n| FE  | 测试中 |\n\"\"\"\n\n# 默认走 card_v2（推荐）\nbot.send_markdown_to_chat(\n    chat_id=\"oc_xxx\",\n    md_text=md,\n    title=\"版本进度\",\n    prefer=\"card_v2\"\n)\n\n# 需要 post 时切换路由\nbot.send_markdown_to_chat(\n    chat_id=\"oc_xxx\",\n    md_text=md,\n    title=\"版本进度\",\n    prefer=\"post\",\n    table_fallback=\"code_block\"\n)"
      },
      {
        "title": "发送消息",
        "body": "Text Message\n\nbot.send_text_to_user(user_open_id, \"私聊消息\")\nbot.send_text_to_chat(chat_id, \"群聊消息\")\n\nImage Message\n\n# 上传图片\nimage_key = bot.upload_image(\"/path/to/image.jpg\")\n\n# 发送图片\nbot.send_image_to_user(user_open_id, image_key)\nbot.send_image_to_chat(chat_id, image_key)\n\nAudio / Media / File Message\n\n# 上传文件\nfile_key = bot.upload_file(\"/path/to/file.pdf\", file_type=\"pdf\")\n\n# 发送音频\nbot.send_audio_to_user(user_open_id, file_key)\n\n# 发送多媒体\nbot.send_media_to_chat(chat_id, file_key)\n\n# 发送文件\nbot.send_file_to_user(user_open_id, file_key)\n\nPost (Rich Text) Message\n\nfrom pywayne.lark_bot import PostContent\n\npost = PostContent(title=\"富文本标题\")\n\n# 添加内容\nline = post.make_text_content(\"这是粗体文本\", styles=[\"bold\"])\npost.add_content_in_new_line(line)\n\n# 发送\nbot.send_post_to_user(user_open_id, post.get_content())\nbot.send_post_to_chat(chat_id, post.get_content())\n\nInteractive Card Message\n\n# 直接传原始 interactive 卡片\ncard = {\n    \"header\": {\"title\": {\"content\": \"卡片标题\", \"tag\": \"plain_text\"}},\n    \"elements\": [...]\n}\nbot.send_interactive_to_user(user_open_id, card)\nbot.send_interactive_to_chat(chat_id, card)\n\nCardContentV2（schema 2.0 卡片构造器）\n\nfrom pywayne.lark_bot import CardContentV2\n\ncard = CardContentV2(title=\"日报\", template=\"blue\")\ncard.add_markdown(\"# 今日进展\\n\\n- 完成接口联调\\n- 修复2个问题\")\ncard.add_hr()\ncard.add_image(img_key=\"img_xxx\")\n\nbot.send_interactive_to_chat(chat_id, card.get_card())\n\nShare Message\n\n# 分享群聊\nbot.send_shared_chat_to_user(user_open_id, shared_chat_id)\nbot.send_shared_chat_to_chat(chat_id, shared_chat_id)\n\n# 分享用户\nbot.send_shared_user_to_user(user_open_id, shared_user_id)\nbot.send_shared_user_to_chat(chat_id, shared_user_id)"
      },
      {
        "title": "PostContent - 富文本构建器",
        "body": "post = PostContent(title=\"标题\")\n\n# 可用内容类型\ntext = post.make_text_content(\"文本\", styles=[\"bold\", \"underline\"])\nlink = post.make_link_content(\"链接文字\", \"https://example.com\")\nat = post.make_at_content(user_open_id)\nimg = post.make_image_content(image_key=\"img_xxx\")\nmedia = post.make_media_content(file_key=\"file_xxx\", image_key=\"thumb_xxx\")\nemoji = post.make_emoji_content(emoji_type=\"OK\")\nhr = post.make_hr_content()\ncode_block = post.make_code_block_content(language=\"python\", text=\"print('hello')\")\nmarkdown = post.make_markdown_content(\"**Markdown**\")\n\n# 添加内容\npost.add_content_in_new_line(text)\npost.add_contents_in_line([link, at])  # 同一行添加多个元素\n\n# 推荐：直接添加 markdown，支持分块与表格降级\nmd = \"\"\"\n## 迭代计划\n| 任务 | 状态 |\n| --- | --- |\n| A   | done |\n| B   | doing |\n\"\"\"\npost.add_markdown(md, table_as=\"code_block\", max_chunk_bytes=8000)"
      },
      {
        "title": "文件操作",
        "body": "# 上传\nimage_key = bot.upload_image(\"/path/to/image.jpg\")\nfile_key = bot.upload_file(\"/path/to/file.pdf\", file_type=\"pdf\")\n\n# 下载\nbot.download_image(image_key, \"/save/path/image.jpg\")\nbot.download_file(file_key, \"/save/path/file.pdf\")\n\n# 下载消息中的所有资源\nresources = bot.download_message_resources(\n    message_id=\"msg_xxx\",\n    message_content='{\"image_key\":\"img_xxx\"}',\n    save_dir=\"/save/dir\"\n)"
      },
      {
        "title": "用户与群组查询",
        "body": "# 获取用户信息\nusers = bot.get_user_info(emails=[\"test@example.com\"], mobiles=[\"13800138000\"])\n\n# 获取群组列表\ngroups = bot.get_group_list()\n\n# 通过群名获取群ID\nchat_ids = bot.get_group_chat_id_by_name(\"项目讨论组\")\n\n# 获取群成员\nmembers = bot.get_members_in_group_by_group_chat_id(chat_id)\n\n# 通过群成员名获取 open_id\nmember_ids = bot.get_member_open_id_by_name(chat_id, \"张三\")\n\n# 获取群名和用户名\nchat_name, user_name = bot.get_chat_and_user_name(chat_id, user_id)"
      },
      {
        "title": "LarkBotListener - 消息监听",
        "body": "飞书消息监听器，用于实时接收和处理消息。\n\nfrom pywayne.lark_bot_listener import LarkBotListener\nfrom pathlib import Path\n\nlistener = LarkBotListener(\n    app_id=\"your_app_id\",\n    app_secret=\"your_app_secret\"\n)"
      },
      {
        "title": "文本消息处理",
        "body": "@listener.text_handler(group_only=False, user_only=False)\nasync def handle_text(text: str, chat_id: str, is_group: bool, group_name: str, user_name: str):\n    print(f\"收到来自 {user_name} 的消息: {text}\")\n    # 回复\n    listener.send_message(chat_id, f\"已收到：{text}\")"
      },
      {
        "title": "图片消息处理",
        "body": "@listener.image_handler(group_only=True)\nasync def handle_image(image_path: Path, chat_id: str, user_name: str):\n    print(f\"收到图片: {image_path}\")\n    # 处理图片..."
      },
      {
        "title": "文件消息处理",
        "body": "@listener.file_handler()\nasync def handle_file(file_path: Path, chat_id: str, user_name: str):\n    print(f\"收到文件: {file_path}\")\n    # 处理文件..."
      },
      {
        "title": "通用消息监听",
        "body": "@listener.listen(message_type=\"post\")\nasync def handle_post(ctx):\n    print(f\"收到富文本消息: {ctx.content}\")"
      },
      {
        "title": "启动监听",
        "body": "listener.run()"
      },
      {
        "title": "监听器参数说明",
        "body": "Handler 参数（除必需参数外均为可选）：\n\nHandler必需参数可选参数text_handlertextchat_id, is_group, group_name, user_nameimage_handlerimage_pathchat_id, is_group, group_name, user_namefile_handlerfile_pathchat_id, is_group, group_name, user_name\n\n装饰器参数：\n\nmessage_type: 消息类型（\"text\", \"image\", \"file\", \"post\"）\ngroup_only=True: 只监听群组消息\nuser_only=True: 只监听私聊消息"
      },
      {
        "title": "注意事项",
        "body": "所有处理函数使用 async/await 语法\n消息会去重（默认 60 秒）\n图片和文件下载到临时目录，处理完及时清理\n每个处理函数异常独立捕获，不影响其他函数"
      }
    ],
    "body": "Pywayne Lark Bot\n\n飞书机器人模块，提供完整飞书 API 交互功能，包括消息发送、文件管理、用户/群组查询和消息监听。\n\nQuick Start\nfrom pywayne.lark_bot import LarkBot, TextContent\n\n# 初始化\nbot = LarkBot(app_id=\"your_app_id\", app_secret=\"your_app_secret\")\n\n# 发送文本消息到用户\nbot.send_text_to_user(user_open_id=\"user_xxx\", text=\"Hello!\")\n\n# 发送文本消息到群聊\nbot.send_text_to_chat(chat_id=\"oc_xxx\", text=\"Group message\")\n\nTextContent - 文本格式化工具\n\n创建各种文本格式，用于发送带格式的文本消息。\n\nMentions\n# @所有人\nat_all = TextContent.make_at_all_pattern()\n\n# @指定用户\nat_user = TextContent.make_at_someone_pattern(user_open_id=\"user_xxx\", username=\"张三\", id_type=\"open_id\")\n\nText Styles\n# 加粗、斜体、下划线、删除线\nbold = TextContent.make_bold_pattern(\"粗体\")\nitalic = TextContent.make_italian_pattern(\"斜体\")\nunderline = TextContent.make_underline_pattern(\"下划线\")\nstrikethrough = TextContent.make_delete_line_pattern(\"删除线\")\n\n# 超链接\nlink = TextContent.make_url_pattern(\"https://example.com\", \"点击访问\")\n\nLarkBot - 消息发送与查询\n推荐路径：发送 Markdown（优先使用）\n\n优先使用 send_markdown_to_chat，它会自动处理大文本分包，并支持两种路由：\n\nprefer=\"card_v2\"（默认）：发送 schema 2.0 interactive 卡片，适合绝大多数 Markdown 场景\nprefer=\"post\"：发送 post 富文本；可设置 table_fallback=\"code_block\" 将 Markdown 表格稳定降级\nmd = \"\"\"\n# 发布说明\n\n- 新增对账接口\n- 修复支付重试逻辑\n\n| 模块 | 状态 |\n| --- | --- |\n| API | 完成 |\n| FE  | 测试中 |\n\"\"\"\n\n# 默认走 card_v2（推荐）\nbot.send_markdown_to_chat(\n    chat_id=\"oc_xxx\",\n    md_text=md,\n    title=\"版本进度\",\n    prefer=\"card_v2\"\n)\n\n# 需要 post 时切换路由\nbot.send_markdown_to_chat(\n    chat_id=\"oc_xxx\",\n    md_text=md,\n    title=\"版本进度\",\n    prefer=\"post\",\n    table_fallback=\"code_block\"\n)\n\n发送消息\nText Message\nbot.send_text_to_user(user_open_id, \"私聊消息\")\nbot.send_text_to_chat(chat_id, \"群聊消息\")\n\nImage Message\n# 上传图片\nimage_key = bot.upload_image(\"/path/to/image.jpg\")\n\n# 发送图片\nbot.send_image_to_user(user_open_id, image_key)\nbot.send_image_to_chat(chat_id, image_key)\n\nAudio / Media / File Message\n# 上传文件\nfile_key = bot.upload_file(\"/path/to/file.pdf\", file_type=\"pdf\")\n\n# 发送音频\nbot.send_audio_to_user(user_open_id, file_key)\n\n# 发送多媒体\nbot.send_media_to_chat(chat_id, file_key)\n\n# 发送文件\nbot.send_file_to_user(user_open_id, file_key)\n\nPost (Rich Text) Message\nfrom pywayne.lark_bot import PostContent\n\npost = PostContent(title=\"富文本标题\")\n\n# 添加内容\nline = post.make_text_content(\"这是粗体文本\", styles=[\"bold\"])\npost.add_content_in_new_line(line)\n\n# 发送\nbot.send_post_to_user(user_open_id, post.get_content())\nbot.send_post_to_chat(chat_id, post.get_content())\n\nInteractive Card Message\n# 直接传原始 interactive 卡片\ncard = {\n    \"header\": {\"title\": {\"content\": \"卡片标题\", \"tag\": \"plain_text\"}},\n    \"elements\": [...]\n}\nbot.send_interactive_to_user(user_open_id, card)\nbot.send_interactive_to_chat(chat_id, card)\n\nCardContentV2（schema 2.0 卡片构造器）\nfrom pywayne.lark_bot import CardContentV2\n\ncard = CardContentV2(title=\"日报\", template=\"blue\")\ncard.add_markdown(\"# 今日进展\\n\\n- 完成接口联调\\n- 修复2个问题\")\ncard.add_hr()\ncard.add_image(img_key=\"img_xxx\")\n\nbot.send_interactive_to_chat(chat_id, card.get_card())\n\nShare Message\n# 分享群聊\nbot.send_shared_chat_to_user(user_open_id, shared_chat_id)\nbot.send_shared_chat_to_chat(chat_id, shared_chat_id)\n\n# 分享用户\nbot.send_shared_user_to_user(user_open_id, shared_user_id)\nbot.send_shared_user_to_chat(chat_id, shared_user_id)\n\nPostContent - 富文本构建器\npost = PostContent(title=\"标题\")\n\n# 可用内容类型\ntext = post.make_text_content(\"文本\", styles=[\"bold\", \"underline\"])\nlink = post.make_link_content(\"链接文字\", \"https://example.com\")\nat = post.make_at_content(user_open_id)\nimg = post.make_image_content(image_key=\"img_xxx\")\nmedia = post.make_media_content(file_key=\"file_xxx\", image_key=\"thumb_xxx\")\nemoji = post.make_emoji_content(emoji_type=\"OK\")\nhr = post.make_hr_content()\ncode_block = post.make_code_block_content(language=\"python\", text=\"print('hello')\")\nmarkdown = post.make_markdown_content(\"**Markdown**\")\n\n# 添加内容\npost.add_content_in_new_line(text)\npost.add_contents_in_line([link, at])  # 同一行添加多个元素\n\n# 推荐：直接添加 markdown，支持分块与表格降级\nmd = \"\"\"\n## 迭代计划\n| 任务 | 状态 |\n| --- | --- |\n| A   | done |\n| B   | doing |\n\"\"\"\npost.add_markdown(md, table_as=\"code_block\", max_chunk_bytes=8000)\n\n文件操作\n# 上传\nimage_key = bot.upload_image(\"/path/to/image.jpg\")\nfile_key = bot.upload_file(\"/path/to/file.pdf\", file_type=\"pdf\")\n\n# 下载\nbot.download_image(image_key, \"/save/path/image.jpg\")\nbot.download_file(file_key, \"/save/path/file.pdf\")\n\n# 下载消息中的所有资源\nresources = bot.download_message_resources(\n    message_id=\"msg_xxx\",\n    message_content='{\"image_key\":\"img_xxx\"}',\n    save_dir=\"/save/dir\"\n)\n\n用户与群组查询\n# 获取用户信息\nusers = bot.get_user_info(emails=[\"test@example.com\"], mobiles=[\"13800138000\"])\n\n# 获取群组列表\ngroups = bot.get_group_list()\n\n# 通过群名获取群ID\nchat_ids = bot.get_group_chat_id_by_name(\"项目讨论组\")\n\n# 获取群成员\nmembers = bot.get_members_in_group_by_group_chat_id(chat_id)\n\n# 通过群成员名获取 open_id\nmember_ids = bot.get_member_open_id_by_name(chat_id, \"张三\")\n\n# 获取群名和用户名\nchat_name, user_name = bot.get_chat_and_user_name(chat_id, user_id)\n\nLarkBotListener - 消息监听\n\n飞书消息监听器，用于实时接收和处理消息。\n\nfrom pywayne.lark_bot_listener import LarkBotListener\nfrom pathlib import Path\n\nlistener = LarkBotListener(\n    app_id=\"your_app_id\",\n    app_secret=\"your_app_secret\"\n)\n\n文本消息处理\n@listener.text_handler(group_only=False, user_only=False)\nasync def handle_text(text: str, chat_id: str, is_group: bool, group_name: str, user_name: str):\n    print(f\"收到来自 {user_name} 的消息: {text}\")\n    # 回复\n    listener.send_message(chat_id, f\"已收到：{text}\")\n\n图片消息处理\n@listener.image_handler(group_only=True)\nasync def handle_image(image_path: Path, chat_id: str, user_name: str):\n    print(f\"收到图片: {image_path}\")\n    # 处理图片...\n\n文件消息处理\n@listener.file_handler()\nasync def handle_file(file_path: Path, chat_id: str, user_name: str):\n    print(f\"收到文件: {file_path}\")\n    # 处理文件...\n\n通用消息监听\n@listener.listen(message_type=\"post\")\nasync def handle_post(ctx):\n    print(f\"收到富文本消息: {ctx.content}\")\n\n启动监听\nlistener.run()\n\n监听器参数说明\n\nHandler 参数（除必需参数外均为可选）：\n\nHandler\t必需参数\t可选参数\ntext_handler\ttext\tchat_id, is_group, group_name, user_name\nimage_handler\timage_path\tchat_id, is_group, group_name, user_name\nfile_handler\tfile_path\tchat_id, is_group, group_name, user_name\n\n装饰器参数：\n\nmessage_type: 消息类型（\"text\", \"image\", \"file\", \"post\"）\ngroup_only=True: 只监听群组消息\nuser_only=True: 只监听私聊消息\n注意事项\n所有处理函数使用 async/await 语法\n消息会去重（默认 60 秒）\n图片和文件下载到临时目录，处理完及时清理\n每个处理函数异常独立捕获，不影响其他函数"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/wangyendt/lark-bot",
    "publisherUrl": "https://clawhub.ai/wangyendt/lark-bot",
    "owner": "wangyendt",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/lark-bot",
    "downloadUrl": "https://openagent3.xyz/downloads/lark-bot",
    "agentUrl": "https://openagent3.xyz/skills/lark-bot/agent",
    "manifestUrl": "https://openagent3.xyz/skills/lark-bot/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/lark-bot/agent.md"
  }
}