feat: add chat-members-add shortcut - #2214
Open
zhangheng023 wants to merge 13 commits into
Open
Conversation
…-members-add ledger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
im +chat-members-addshortcut that adds users and/or bots to an existing group chat. It replaces the rawim chat.members createmeta API call — which requires two separate JSON blobs (--paramsforchat_id/member_id_type/succeed_type,--dataforid_list) and an implicit rule that a user ID's format must matchmember_id_typewhile bot IDs are alwaysapp_id— with two plain flags (--users,--bots) and a fixedmember_id_type=open_id, removing that footgun entirely.Changes
shortcuts/im/im_chat_members_add.go:--chat-id(required),--users(comma-separatedou_xxx, max 50),--bots(comma-separatedcli_xxx, max 5),--succeed-type(0 = strict / 1 = partial-success, default 1)ok:falseledger envelope (mirrors the existing+feed-shortcut-createconvention), 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 succeededshortcuts/im/shortcuts.goskills/lark-im/references/lark-im-chat-members-add.md;SKILL.mdShortcuts/permission tables updatedlark-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+messages-search(its affordance example still pinned--as userafter a recent PR made it dual-identity) was also corrected, since it was blocking a cleango testsignal for this branchTest Plan
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-typestrict/partial modeslark-cli im +chat-members-add --chat-id oc_xxx --users ou_xxx --bots cli_xxxagainst a real Feishu tenant — confirmed the partial-failure ledger output and the empty--users/--botsvalidation errorRelated Issues