Skip to content

Pinvou/pinvou-agent / pinvou3-app/src-tauri/resources/common/bundle/lark-skills/lark-im

lark-im

Verified

【何时用:仅当用户明确指向飞书/Lark(发到飞书、飞书文档等)时使用;泛指做个文档或PPT或表格或方案默认走本地工具,不要误用飞书】飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)与卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索或创建群聊/话题群、管理标记数据、Feed 置顶与标签数据、处理卡片回调时使用。

FileKindSize
SKILL.mdskill md24.6 KB
references/card/card-2.0-schema.mdmarkdown6.0 KB
references/card/components/button.mdmarkdown2.8 KB
references/card/components/chart.mdmarkdown2.2 KB
references/card/components/checker.mdmarkdown1.9 KB
references/card/components/collapsible_panel.mdmarkdown1.8 KB
references/card/components/column_set.mdmarkdown2.5 KB
references/card/components/date_picker.mdmarkdown1.6 KB
references/card/components/div.mdmarkdown1.7 KB
references/card/components/form.mdmarkdown2.2 KB
references/card/components/header.mdmarkdown1.6 KB
references/card/components/hr.mdmarkdown425 B
references/card/components/img.mdmarkdown1.4 KB
references/card/components/img_combination.mdmarkdown1.0 KB
references/card/components/input.mdmarkdown2.0 KB
references/card/components/interactive_container.mdmarkdown2.2 KB
references/card/components/markdown.mdmarkdown3.2 KB
references/card/components/multi_select_person.mdmarkdown1.6 KB
references/card/components/multi_select_static.mdmarkdown1.6 KB
references/card/components/overflow.mdmarkdown1.5 KB
references/card/components/person.mdmarkdown907 B
references/card/components/person_list.mdmarkdown1.2 KB
references/card/components/picker_datetime.mdmarkdown1.5 KB
references/card/components/picker_time.mdmarkdown1.5 KB
references/card/components/recycling_container.mdmarkdown1.5 KB
references/card/components/select_img.mdmarkdown1.9 KB
references/card/components/select_person.mdmarkdown1.5 KB
references/card/components/select_static.mdmarkdown1.8 KB
references/card/components/table.mdmarkdown2.1 KB
references/card/lark-im-card-create.mdmarkdown10.8 KB
references/card/lark-im-card-style.mdmarkdown18.3 KB
references/card/resource/colors.mdmarkdown1.4 KB
references/card/resource/icons.mdmarkdown2.3 KB
references/lark-im-card-action-reply.mdmarkdown9.5 KB
references/lark-im-chat-create.mdmarkdown7.9 KB
references/lark-im-chat-identity.mdmarkdown3.3 KB
references/lark-im-chat-list.mdmarkdown9.3 KB
references/lark-im-chat-members-list.mdmarkdown5.2 KB
references/lark-im-chat-messages-list.mdmarkdown11.1 KB
references/lark-im-chat-search.mdmarkdown8.4 KB
references/lark-im-chat-update.mdmarkdown3.5 KB
references/lark-im-feed-group-list-item.mdmarkdown3.1 KB
references/lark-im-feed-group-list.mdmarkdown2.7 KB
references/lark-im-feed-group-query-item.mdmarkdown2.3 KB
references/lark-im-feed-groups.mdmarkdown18.3 KB
references/lark-im-feed-shortcut-create.mdmarkdown4.2 KB
references/lark-im-feed-shortcut-list.mdmarkdown5.0 KB
references/lark-im-feed-shortcut-remove.mdmarkdown2.1 KB
references/lark-im-flag-cancel.mdmarkdown2.9 KB
references/lark-im-flag-create.mdmarkdown2.7 KB
references/lark-im-flag-list.mdmarkdown4.6 KB
references/lark-im-message-enrichment.mdmarkdown7.0 KB
references/lark-im-message-read-status.mdmarkdown4.3 KB
references/lark-im-messages-edit.mdmarkdown6.4 KB
references/lark-im-messages-mget.mdmarkdown6.8 KB
references/lark-im-messages-reply.mdmarkdown17.1 KB
references/lark-im-messages-resources-download.mdmarkdown4.2 KB
references/lark-im-messages-search.mdmarkdown13.6 KB
references/lark-im-messages-send.mdmarkdown19.3 KB
references/lark-im-reactions.mdmarkdown10.3 KB
references/lark-im-scopes.mdmarkdown2.2 KB
references/lark-im-threads-messages-list.mdmarkdown6.4 KB

references/lark-im-messages-mget.md

View on GitHub
# im +messages-mget

> **Prerequisite:** Read [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) first to understand authentication, global parameters, and safety rules.

Fetch message details in batch. Given a list of message IDs, this returns the full content for multiple messages in one call and automatically resolves sender names.

By default the response also carries a `reactions` block (counts + details from `im.reactions.batch_query`) on every message that has reactions, and `update_time` on messages that were actually edited. Replies inside `thread_replies` participate in the same batched enrichment. Pass `--no-reactions` to skip the extra round-trip. Pass `--download-resources` to additionally download message resources (image/file/audio/video/media + post-embedded, excluding stickers) into `./lark-im-resources/` and attach a `resources` block — off by default, no extra requests when omitted. See [message enrichment](lark-im-message-enrichment.md) for the full contract.

> **Supports both `--as user` (default) and `--as bot`.**

This skill maps to the shortcut: `lark-cli im +messages-mget` (internally calls `GET /open-apis/im/v1/messages/mget`).

## Commands

```bash
# Fetch a single message
lark-cli im +messages-mget --message-ids om_xxx

# Fetch multiple messages in batch (comma-separated)
lark-cli im +messages-mget --message-ids "om_aaa,om_bbb,om_ccc"

# JSON output
lark-cli im +messages-mget --message-ids "om_aaa,om_bbb" --format json

# Preview the request without executing it
lark-cli im +messages-mget --message-ids "om_aaa" --dry-run
```

## Parameters

| Parameter | Required | Limits | Description |
|------|------|------|------|
| `--message-ids <ids>` | Yes | At least one, max 50, `om_xxx` format, comma-separated | Message ID list |
| `--no-reactions` | No | — | Skip auto-fetching the `reactions` block |
| `--download-resources` | No | — | Download message resources (image/file/audio/video/media + post-embedded, excluding stickers) into `./lark-im-resources/` and attach a `resources` block. Off by default |

## Output Fields

| Field | Description |
|------|------|
| `messages` | Message array |
| `total` | Number of messages returned |

Each message contains:

| Field | Description |
|------|------|
| `message_id` | Message ID |
| `msg_type` | Message type (`text`, `image`, `file`, etc.) |
| `create_time` | Creation time |
| `sender` | Sender information (includes `name`) |
| `content` | Message content |

For `folder` messages, `content` carries a folder key; `mget` expands the folder one level, rendering first-level children inside the folder tag (to expand/download folder children yourself, follow the Folder resources note in [`lark-im`](../SKILL.md)):

```
<folder key="file_v3_...g" name="assets" child_count="5">
  <file key="file_v3_...g" name="a.pdf"/>
  <folder key="file_v3_...g" name="sub" child_count="2"/>
</folder>
```

- `child_count` on the root folder is the total first-level item count reported by the API; when a folder has more first-level children than the render cap (10), the tag carries `has_more="true"`.
- `child_count` on a nested `<folder>` child is that child's own child count (a depth hint; nested folders are not expanded further).
- A genuinely empty folder renders as `<folder key="..." name="..." child_count="0"/>`.

For `post` messages, the attachment zone (top-level `files` array) is rendered as trailing lines in `content`, one per attachment:

- `<file key="file_xxx" name="report.pdf"/>` — a file with a display name (same tag style as a standalone `file` message)
- `<file key="file_xxx"/>` — a file with an empty display name (the server always backfills names, so this branch is rare but valid on the wire)
- `<folder key="file_xxx" name="assets"/>` — a folder attachment (`is_folder: true`). Like folder messages, the attachment is expanded one level (children rendered inside the tag) when runtime + message id are available; otherwise it degrades to this single-line tag.

Use `--format json` to see the full content without table truncation — note the content is the rendered text (including the `<file>`/`<folder>` lines above), not the raw post JSON.

Downloading: [`+messages-resources-download`](lark-im-messages-resources-download.md) takes an explicit `--message-id` + `--file-key` and fetches `GET /messages/:id/resources/:file_key` — this works for standalone `file` message keys, top-level `post` attachment `files[]` entries, **and file keys rendered inside `<folder>...</folder>` (folder children are real files addressed by their own file_key)**. Two caveats:
- `--download-resources` (the automatic enrichment flag on list/get commands) only auto-collects top-level single-file resources from the raw content — folder children are expanded at render time and are **not** auto-added to that worklist, so to download a folder child you pass its key explicitly to `+messages-resources-download`.
- `is_folder` entries themselves (a folder, not a file) are not downloadable as a single resource.

## Usage Scenarios

### Scenario 1: Fetch the full content of a specific message

```bash
lark-cli im +messages-mget --message-ids om_xxx --format json
```

### Scenario 2: Fetch multiple messages in one batch

```bash
lark-cli im +messages-mget --message-ids "om_aaa,om_bbb,om_ccc"
```

### Scenario 3: Use together with the message list command

First get message IDs via `+chat-messages-list`, then fetch full content via `+messages-mget`:

```bash
# Get the message list
lark-cli im +chat-messages-list --chat-id oc_xxx --format json

# Fetch specific message details
lark-cli im +messages-mget --message-ids "om_aaa,om_bbb"
```

## Common Errors and Troubleshooting

| Symptom | Root Cause | Solution |
|---------|---------|---------|
| `--message-ids requires at least one message ID` | No message ID was provided | Provide at least one message ID |
| `invalid message ID: must start with om_` | Invalid message ID format | Message IDs must start with `om_` |
| Permission denied | Message read permission is missing | Ensure the app has `im:message:readonly` enabled |
| Empty result | Message IDs do not exist or are not accessible | Verify the IDs and access permissions |

## AI Usage Guidance

1. **Use JSON for full content:** table output truncates content. Use `--format json` when the full body matters.
2. **Sender names are already enriched:** the command resolves sender names automatically, so no extra lookup is required.
3. **Images are rendered as placeholders:** image messages appear as placeholders such as `![Image](img_xxx)`. Use `+messages-resources-download` when you need the binary resource.
4. **Batching is more efficient:** fetching multiple IDs in one request is better than calling the API repeatedly.

## References

- [lark-im](../SKILL.md) - all IM commands
- [lark-shared](../../lark-shared/SKILL.md) - authentication and global parameters
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall