From 9790cb48309bce8eca296cc7d4e4def54dab4133 Mon Sep 17 00:00:00 2001 From: nullkey Date: Wed, 1 Apr 2026 21:19:31 +0800 Subject: [PATCH] feat(im): add QuotedMessage type and Quote field to IncomingMessage --- internal/im/adapter.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/internal/im/adapter.go b/internal/im/adapter.go index ea642b53..a82b61d4 100644 --- a/internal/im/adapter.go +++ b/internal/im/adapter.go @@ -71,10 +71,26 @@ type IncomingMessage struct { // In thread mode, top-level messages use their own ID as ThreadID, // effectively creating a new session per top-level message. ThreadID string + // Quote is the quoted/replied message, if any. + // Populated by adapters on platforms that support quote-reply. + Quote *QuotedMessage // Extra holds platform-specific fields (e.g., WeCom stream ID). Extra map[string]string } +// QuotedMessage holds the content and metadata of a quoted/replied message. +// Populated by platform adapters that support quote-reply (e.g. WeCom long-connection). +type QuotedMessage struct { + // MessageID is the platform message ID of the quoted message. + MessageID string + // Content is the text content (or placeholder like "[图片]" for non-text). + Content string + // SenderID is the platform user ID of the quoted message's author. + SenderID string + // IsBotMessage indicates whether the quoted message was from the bot. + IsBotMessage bool +} + // ChatType represents the IM chat type. type ChatType string