mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:58:26 +00:00
fix(telegram): include forward_from_chat metadata in forwarded message context (#8133)
Extract missing metadata from forwarded Telegram messages: - Add fromChatType to TelegramForwardedContext, capturing the original chat type (channel/supergroup/group) from forward_from_chat.type and forward_origin.chat/sender_chat.type - Add fromMessageId to capture the original message ID from channel forwards - Read author_signature from forward_origin objects (modern API), preferring it over the deprecated forward_signature field - Pass ForwardedFromChatType and ForwardedFromMessageId through to the inbound context payload - Add test coverage for forward_origin channel/chat types, including author_signature extraction and fromChatType propagation
This commit is contained in:
@@ -598,6 +598,8 @@ export const buildTelegramMessageContext = async ({
|
||||
ForwardedFromUsername: forwardOrigin?.fromUsername,
|
||||
ForwardedFromTitle: forwardOrigin?.fromTitle,
|
||||
ForwardedFromSignature: forwardOrigin?.fromSignature,
|
||||
ForwardedFromChatType: forwardOrigin?.fromChatType,
|
||||
ForwardedFromMessageId: forwardOrigin?.fromMessageId,
|
||||
ForwardedDate: forwardOrigin?.date ? forwardOrigin.date * 1000 : undefined,
|
||||
Timestamp: msg.date ? msg.date * 1000 : undefined,
|
||||
WasMentioned: isGroup ? effectiveWasMentioned : undefined,
|
||||
|
||||
Reference in New Issue
Block a user