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:
Glucksberg
2026-02-03 23:00:57 +00:00
committed by Ayaan Zaidi
parent da6de49815
commit 57566c5e4d
4 changed files with 97 additions and 0 deletions

View File

@@ -56,6 +56,8 @@ export type MsgContext = {
ForwardedFromUsername?: string;
ForwardedFromTitle?: string;
ForwardedFromSignature?: string;
ForwardedFromChatType?: string;
ForwardedFromMessageId?: number;
ForwardedDate?: number;
ThreadStarterBody?: string;
ThreadLabel?: string;