fix(gateway/telegram): use quoted fragment over full reply text - #23091
Closed
j2h4u wants to merge 2 commits into
Closed
fix(gateway/telegram): use quoted fragment over full reply text#23091j2h4u wants to merge 2 commits into
j2h4u wants to merge 2 commits into
Conversation
When a user cites a specific fragment in Telegram (message.quote.text), prefer that over the full replied message text/caption. The full text is only used as fallback when no quote is present.
Collaborator
Author
|
Closing — upstream fixed the same issue independently in the same release batch (#22619). The fix is now in main. |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When a user selects and cites a specific fragment of a message in Telegram (partial quote), the cited text is available in
message.quote.text(aTextQuoteobject). The gateway was ignoring this and always using the fullreply_to_message.textinstead.Why
Telegram's partial quote feature lets users highlight exactly the words they're replying to. Passing the full message text as reply context is misleading — the agent receives far more text than the user intended to reference.
Change
message.quoteisNonewhen the user replies without selecting a fragment (standard reply), so existing behaviour is fully preserved as a fallback.How to test
reply_to_textin the resultingMessageEventcontains only the selected fragment, not the full messageTested on: Linux (python-telegram-bot 22.6)