Skip to content

feat: add message operations (recall, edit, react, pin, mark-read, thread reply)#15

Open
echowxsy wants to merge 1 commit into
cv-cat:masterfrom
echowxsy:feat/message-operations
Open

feat: add message operations (recall, edit, react, pin, mark-read, thread reply)#15
echowxsy wants to merge 1 commit into
cv-cat:masterfrom
echowxsy:feat/message-operations

Conversation

@echowxsy
Copy link
Copy Markdown

Summary

Backport message operations from the Go implementation (larkmsg) to LarkAgentX:

  • Recall message (cmd=9) — Delete/recall a sent message
  • Edit message (cmd=900010) — Edit existing text message content
  • Add/Remove reaction (cmd=25/26) — Emoji reactions with alias mapping (Chinese/English/emoji → Feishu type)
  • Pin/Unpin message (cmd=5100/5103) — Pin messages to chat top
  • Mark as read (cmd=40) — Mark messages as read
  • Thread reply (cmd=5 with rootId) — Reply in thread/topic

Changes

  • static/proto.proto — Add 11 new protobuf message definitions (DeleteMessagesRequest, EditMessageRequest, CreateReactionRequest, etc.)
  • static/proto_pb2.py — Regenerated from updated proto.proto
  • builder/header.py — Add generic build_proto_header(cmd, cmd_version) to reduce code duplication (updated UA headers matching web version 7.63.0)
  • builder/proto.py — Add 8 builder/decoder methods + raw protobuf encoding helpers; extract messageId from incoming WebSocket messages
  • app/api/lark_client.py — Add 9 new API methods, command constants, emoji alias mapping, and response checking

Test plan

  • Verify recall_message() successfully deletes a message
  • Verify edit_message() updates message content
  • Verify add_reaction() / remove_reaction() with emoji aliases
  • Verify pin_message() / unpin_message() operations
  • Verify mark_read() marks chat as read
  • Verify send_msg_in_thread() replies in thread context
  • Verify messageId is correctly extracted in WebSocket message processing

🤖 Generated with Claude Code

…read reply)

- Add protobuf definitions for delete, edit, reaction, pin, and mark-read messages
- Add generic header builder to reduce code duplication
- Add ProtoBuilder methods for all new operations with raw protobuf encoding
- Add LarkClient methods: recall_message, edit_message, add/remove_reaction,
  pin/unpin_message, mark_read, send_msg_in_thread
- Extract message_id from incoming WebSocket messages
- Add emoji reaction alias mapping (Chinese/English/emoji → Feishu type)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant