Skip to content

feat: add chat-members-add shortcut - #2214

Open
zhangheng023 wants to merge 13 commits into
mainfrom
feat/im-add-members-shortcut
Open

feat: add chat-members-add shortcut#2214
zhangheng023 wants to merge 13 commits into
mainfrom
feat/im-add-members-shortcut

Conversation

@zhangheng023

Copy link
Copy Markdown
Collaborator

Summary

Adds a new im +chat-members-add shortcut that adds users and/or bots to an existing group chat. It replaces the raw im chat.members create meta API call — which requires two separate JSON blobs (--params for chat_id/member_id_type/succeed_type, --data for id_list) and an implicit rule that a user ID's format must match member_id_type while bot IDs are always app_id — with two plain flags (--users, --bots) and a fixed member_id_type=open_id, removing that footgun entirely.

Changes

  • New shortcut shortcuts/im/im_chat_members_add.go: --chat-id (required), --users (comma-separated ou_xxx, max 50), --bots (comma-separated cli_xxx, max 5), --succeed-type (0 = strict / 1 = partial-success, default 1)
  • Partial-failure reporting via an ok:false ledger envelope (mirrors the existing +feed-shortcut-create convention), covering all three server response buckets (invalid_id_list, not_existed_id_list, pending_approval_id_list) so a member that failed to join is never miscounted as succeeded
  • Registered in shortcuts/im/shortcuts.go
  • New skill reference doc skills/lark-im/references/lark-im-chat-members-add.md; SKILL.md Shortcuts/permission tables updated
  • Two existing docs (lark-im-chat-create.md, affordance/im.md) updated to point their two-step invite examples at the new shortcut instead of the raw meta command
  • Incidental fix: an unrelated, pre-existing doc-drift bug on +messages-search (its affordance example still pinned --as user after a recent PR made it dual-identity) was also corrected, since it was blocking a clean go test signal for this branch

Test Plan

  • Unit tests pass (go test ./shortcuts/im/..., go test ./internal/affordance/...) — covers flag validation, dry-run, the full ledger (all-success / partial-failure across all three failure buckets), and the --succeed-type strict/partial modes
  • Build and static checks pass
  • Manual verification: lark-cli im +chat-members-add --chat-id oc_xxx --users ou_xxx --bots cli_xxx against a real Feishu tenant — confirmed the partial-failure ledger output and the empty --users/--bots validation error

Related Issues

  • None

@github-actions github-actions Bot added domain/im PR touches the im domain size/L Large or sensitive change across domains or core paths labels Aug 6, 2026
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 feature size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant