Skip to content

fix: 转发时保留 Telegram 部分引用摘录 - #88

Merged
pplulee merged 2 commits into
devfrom
cursor/preserve-quote-excerpt-1349
Nov 5, 2026
Merged

pplulee merged 2 commits into
devfrom
cursor/preserve-quote-excerpt-1349

Conversation

@pplulee

@pplulee pplulee commented Nov 5, 2026

Copy link
Copy Markdown
Member

Telegram 手动「引用」消息中的某一段时,Bot API 会同时提供 reply_to_message 和 Message.quote(TextQuote)。此前转发只映射了整条回复的 reply_to_message_id,所以部分引用会被当成对来源整条消息的回复。

本次改动:

  • 区分手动/部分引用(Message.quote 且 is_manual 不为 False)与普通整条回复
  • 转发部分引用时通过 ReplyParameters.quote / quote_position / quote_entities 保留被选中的摘录
  • 普通整条回复仍走原来的 reply_to_message_id 映射
  • 找不到对端消息,或 Telegram 拒绝该 quote(例如 QUOTE_TEXT_INVALID)时,把摘录嵌入 HTML <blockquote>,避免引用内容丢失

Fixes #84

Open in Web Open in Cursor 

pplulee and others added 2 commits October 27, 2026 21:42
Manual partial quotes now forward via ReplyParameters so the cited
text is shown instead of a full-message reply. Ordinary swipe-replies
keep the existing mapped reply_to_message_id behavior.

Co-authored-by: pplulee <hi@pplulee.me>
@pplulee
pplulee changed the base branch from main to dev November 5, 2026 02:36
@pplulee
pplulee merged commit 207023c into dev Nov 5, 2026
1 check passed
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.

信息被引用的部分原样转发

2 participants