
Feishu Chat History
- 32 installs
- 263 repo stars
- Updated July 22, 2026
- zrt-ai-lab/opencode-skills
Helps with ai & agent building tasks during AI-assisted development.
About
feishu-chat-history is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- feishu-chat-history
- AI & Agent Building
- AI-coding skill
Feishu Chat History by the numbers
- 32 all-time installs (skills.sh)
- Ranked #9,000 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/zrt-ai-lab/opencode-skills --skill feishu-chat-historyAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 32 |
|---|---|
| repo stars | ★ 263 |
| Last updated | July 22, 2026 |
| Repository | zrt-ai-lab/opencode-skills ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
Feishu Chat History
Fetch message history from a Feishu group chat and summarize or present it to the user.
When to Use
- User asks what was discussed in a group
- User wants a summary or review of recent messages
- User provides a chat_id or is in a group and asks about its history
How to Fetch Messages
Use the Feishu IM API directly via Python. See references/api.md for full details.
Quick summary: 1. Read credentials from config → channels.feishu.appId / appSecret 2. Get tenant_access_token via POST /auth/v3/tenant_access_token/internal 3. Fetch messages via GET /im/v1/messages?container_id_type=chat&container_id={chat_id}&page_size=50
Identifying the chat_id
- If the user is asking about the current group chat, use the
chat_idfrom the inbound metadata (chat:oc_xxxxx→ strip thechat:prefix to get the raw ID) - If the user provides a different group, ask for the chat_id
Presenting Results
Parse each message and present a clean summary:
- Filter out
msg_type=system(join/leave events) unless relevant - For
msg_type=text: extract.body.contentas JSON, get thetextfield - For
msg_type=interactive: extract text nodes from theelementsarray - For
msg_type=image: note as[图片] - Include sender name (from
mentionsor known bot app_ids), timestamp, and content - Group by thread if
root_idis present - End with a human-readable summary of topics discussed
Pagination
If has_more=true, fetch more pages using page_token. Default: fetch 1 page (50 messages). Ask user if they want more.
feishu-chat-history
获取并总结飞书群聊消息记录,快速了解群里聊了什么。
能力
- 拉取指定飞书群的最近消息(默认 50 条/页)
- 自动解析 text / interactive / image 等消息类型
- 按话题分组、生成人类可读的讨论摘要
- 支持分页加载更多历史消息
触发场景
- "看群聊记录"、"群里聊了啥"
- "帮我看看这个群"、"群消息历史"
- "chat history"、"what did the group discuss"
工作原理
1. 从配置读取飞书应用凭据(appId / appSecret) 2. 获取 tenant_access_token 3. 调用 GET /im/v1/messages 拉取群消息 4. 解析各类型消息内容,过滤系统消息 5. 生成讨论话题摘要
消息解析
| 类型 | 处理方式 |
|---|---|
text | 提取 body.content JSON 中的 text 字段 |
interactive | 从 elements 数组提取文本节点 |
image | 标记为 [图片] |
system | 默认过滤(加入/退出事件) |
配置
需要飞书应用凭据,通过 channels.feishu.appId / appSecret 配置。
License
MIT
Feishu IM API Reference
Auth
POST https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal
Content-Type: application/json
{"app_id": "...", "app_secret": "..."}Response: {"tenant_access_token": "...", "expire": 7200}
Fetch Chat Messages
GET https://open.feishu.cn/open-apis/im/v1/messages
?container_id_type=chat
&container_id={chat_id}
&page_size=50
[&page_token={token}] # pagination
[&start_time={unix_ms}] # filter by time range
[&end_time={unix_ms}]
Authorization: Bearer {tenant_access_token}Response fields:
data.items[]: message list (newest first by default)data.has_more: booldata.page_token: use for next page
Message Object Fields
| Field | Description |
|---|---|
message_id | Unique ID |
msg_type | text, interactive, image, post, system |
body.content | JSON string — parse it |
sender.id | Sender open_id (user) or app_id (bot) |
sender.sender_type | user or app |
mentions[] | List of @mentioned users with name and id |
create_time | Unix ms timestamp |
root_id | Thread root message ID (if in a thread) |
parent_id | Direct parent message ID |
Parsing msg_type
text
{"text": "hello world @_user_1"}Replace @_user_X keys with the corresponding mentions[].name.
interactive (card)
{"title": null, "elements": [[{"tag": "text", "text": "..."}, ...]]}Walk elements and concatenate all tag=text nodes.
post
{"title": "", "content": [[{"tag": "text", "text": "...", "style": []}]]}Walk content rows and concatenate text nodes.
image
{"image_key": "img_v3_..."}Render as [图片].
system
Template messages like join/leave events. Usually skip unless relevant.
Python Snippet
import json, os, urllib.request
config_path = os.path.expanduser('~/.openclaw-autoclaw/openclaw.json')
with open(config_path) as f:
cfg = json.load(f)['channels']['feishu']
# Auth
req = urllib.request.Request(
'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal',
data=json.dumps({'app_id': cfg['appId'], 'app_secret': cfg['appSecret']}).encode(),
headers={'Content-Type': 'application/json'}
)
token = json.loads(urllib.request.urlopen(req).read())['tenant_access_token']
# Fetch messages
chat_id = 'oc_xxxxxx'
url = f'https://open.feishu.cn/open-apis/im/v1/messages?container_id_type=chat&container_id={chat_id}&page_size=50'
req2 = urllib.request.Request(url, headers={'Authorization': f'Bearer {token}'})
data = json.loads(urllib.request.urlopen(req2).read())
messages = data['data']['items']
has_more = data['data'].get('has_more', False)
page_token = data['data'].get('page_token')