Skip to content

docs(lark-im): document @mention format per message type (text/post/card) - #1419

Merged
YangJunzhou-01 merged 1 commit into
larksuite:mainfrom
sammi-bytedance:docs/im-card-mention-formats
Jun 15, 2026
Merged

docs(lark-im): document @mention format per message type (text/post/card)#1419
YangJunzhou-01 merged 1 commit into
larksuite:mainfrom
sammi-bytedance:docs/im-card-mention-formats

Conversation

@sammi-bytedance

@sammi-bytedance sammi-bytedance commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

The @Mention Format sections of the im +messages-send / im +messages-reply reference docs only covered text/post. This documents the <at> syntax for each message type, including interactive cards, whose syntax differs and is not normalized by the shortcut.

Changes

  • text: <at user_id="ou_xxx">name</at> (inner display name optional), @all via user_id="all"; keep the note that the shortcut normalizes id=/open_id= into user_id=.
  • post: inline <at user_id=...> inside text/md elements, or a dedicated {"tag":"at","user_id":"ou_xxx"} element node.
  • interactive (card): card-native syntax <at id=ou_xxx>, multi-user <at ids=ou_xxx1,ou_xxx2>, by-email <at email=...>; explicitly note card content is passed through verbatim (only text/post are normalized).

Test Plan

  • Docs-only change; no code touched, no tests affected.
  • Verified mention handling against the source: normalizeAtMentions runs only for text/post (shortcuts/im/im_messages_send.go, im_messages_reply.go); interactive content is untouched.

Related Issues

  • None

Summary by CodeRabbit

  • Documentation
    • Updated @mention format guidance to clarify syntax differences across message types: text, post, and interactive cards.
    • Documented that mention shortcuts normalize common variants for text and post types only.
    • Interactive card content requires card-native syntax as normalization is not applied.
    • Added distinct examples and requirements for single user, @all, multiple users, and email-based mentions by message type.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3e22df6f-ff81-424e-b516-c3593a63dd72

📥 Commits

Reviewing files that changed from the base of the PR and between f1e2c10 and 241c18c.

📒 Files selected for processing (2)
  • skills/lark-im/references/lark-im-messages-reply.md
  • skills/lark-im/references/lark-im-messages-send.md
💤 Files with no reviewable changes (2)
  • skills/lark-im/references/lark-im-messages-send.md
  • skills/lark-im/references/lark-im-messages-reply.md

📝 Walkthrough

Walkthrough

Two Lark IM reference documentation files (lark-im-messages-send.md and lark-im-messages-reply.md) have their "@Mention Format" sections updated. The combined "text / post" guidance is split into separate subsections for text, post, and interactive (card) message types, with new card-native <at> syntax examples added.

Changes

Lark IM @Mention Format Documentation

Layer / File(s) Summary
Mention format docs for send and reply
skills/lark-im/references/lark-im-messages-send.md, skills/lark-im/references/lark-im-messages-reply.md
Both files replace the old combined "text / post" mention guidance with per-type sections covering text, post, and interactive (card). New content specifies that card content is not normalized and must use card-native <at> forms for single user, multiple users, and email-based mentions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • YangJunzhou-01
  • SunPeiYang996

Poem

🐰 Hippity-hoppity, docs are neat,
Each message type gets its own treat!
text and post get normalized care,
Cards use native <at> with flair.
The rabbit stamps approval — precise and clear! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: documenting @mention format across different message types (text/post/card) in Lark IM documentation.
Description check ✅ Passed The PR description follows the template structure with complete Summary, Changes, Test Plan, and Related Issues sections; all required information is present and detailed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added domain/im PR touches the im domain size/M Single-domain feat or fix with limited business impact labels Jun 12, 2026
@sammi-bytedance
sammi-bytedance force-pushed the docs/im-card-mention-formats branch from 9fcbca1 to b7a63b4 Compare June 12, 2026 02:52

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/lark-im/references/lark-im-messages-reply.md`:
- Around line 242-247: The interactive card markup uses an incorrect multi-user
mention attribute (`ids=`); update the `<at>` tag examples in
lark-im-messages-reply.md so multi-user mentions use a single id attribute with
comma-separated values (e.g., change `<at ids=ou_xxx1,ou_xxx2></at>` to `<at
id=ou_xxx1,ou_xxx2></at>`), and ensure the single-user example remains `<at
id=ou_xxx></at>` and the email form remains `<at email=user@example.com></at>`
inside the lark_md/markdown card content.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea7e90c4-910d-4384-9a7f-71eededd6755

📥 Commits

Reviewing files that changed from the base of the PR and between 510545f and 9fcbca1.

📒 Files selected for processing (2)
  • skills/lark-im/references/lark-im-messages-reply.md
  • skills/lark-im/references/lark-im-messages-send.md

Comment thread skills/lark-im/references/lark-im-messages-reply.md
YangJunzhou-01
YangJunzhou-01 previously approved these changes Jun 15, 2026
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.35%. Comparing base (c0730b4) to head (241c18c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1419   +/-   ##
=======================================
  Coverage   73.35%   73.35%           
=======================================
  Files         750      750           
  Lines       69250    69250           
=======================================
  Hits        50799    50799           
  Misses      14711    14711           
  Partials     3740     3740           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@241c18c8ecf8054eadcb6e9c18dec46577a30510

🧩 Skill update

npx skills add sammi-bytedance/larksuite-cli#docs/im-card-mention-formats -y -g

…ard)

Split the send/reply @Mention sections by message type:
- text: <at user_id="ou_xxx">name</at> (inner name optional), @ALL
- post: inline form in text/md elements, or a dedicated {"tag":"at"} node
- interactive card: card-native <at id=>, <at ids=>, <at email=>; note that
  the shortcut does NOT normalize card content (only text/post).

Also apply gofmt -s to shortcuts/im/im_threads_messages_list.go to drop
redundant []string composite-literal types flagged by golangci-lint.

Change-Id: Ie407cc9d4d2f772856fc890bf8e801a4b88b8263
@sammi-bytedance
sammi-bytedance force-pushed the docs/im-card-mention-formats branch from f1e2c10 to 241c18c Compare June 15, 2026 04:15
@YangJunzhou-01
YangJunzhou-01 merged commit 37f4f89 into larksuite:main Jun 15, 2026
19 checks passed
luozhixiong01 added a commit that referenced this pull request Jun 16, 2026
Rebased onto main v1.0.54, which added IM content after this branch forked.
Fold main's new facts into the slimmed/gotcha-only form and fix drift:

- SKILL.md: compact the newly-merged chat.user_setting / chat.managers /
  chat.moderation API resources to the api_compact `action`(identity) form
  (consistent with the rest; regen-equivalent), and note the opt-in
  `--download-resources` flag on the three message-pulling shortcuts.
- chat-search: fix stale `--sort-by` -> `--sort`, add `--chat-modes`, and
  fold the "`--sort` is always descending" caution (#1302/#1317).
- chat-messages-list: note `--order` is the only sort axis (no field sort).
- messages-send: split @mention by message type; interactive cards are not
  normalized and need card-native `<at>` syntax (#1419).
- flag-cancel: document best-effort double-cancel (feed layer skipped with a
  stderr warning when chat type is undeterminable).
- feed-group-list-item / query-item: p2p cards omit chat_name; resolve via
  chats/batch_query -> p2p_target_id -> contact lookup.
- message-enrichment: add the `--download-resources` contract (merge_forward
  container-id 234003 trap, fail-silent isolation, no extra scope) (#1245).

Docs only; no Go/--help/Desc changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/im PR touches the im domain size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants