Fix Handling of Parameters do_quote and allow_sending_without_reply in Message.reply_*#4818
Merged
Bibo-Joshi merged 9 commits intomasterfrom Jun 19, 2025
Merged
Fix Handling of Parameters do_quote and allow_sending_without_reply in Message.reply_*#4818Bibo-Joshi merged 9 commits intomasterfrom
do_quote and allow_sending_without_reply in Message.reply_*#4818Bibo-Joshi merged 9 commits intomasterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the handling of the do_quote and allow_sending_without_reply parameters in the Message.reply_* methods, ensuring they are mutually exclusive and correctly propagated to ReplyParameters. Key changes include adjusting test methods to pass an additional flag, updating helper functions to remove old parameters, and modifying the internal parsing and construction of ReplyParameters in _message.py.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_message.py | Updates to test functions to pass a new instance parameter and validate error messages. |
| tests/auxil/bot_method_checks.py | Removal of legacy "quote" parameter references and corresponding adjustments in assertions. |
| src/telegram/_message.py | Modifications to include the new allow_sending_without_reply parameter in quote handling logic. |
| docs/substitutions/global.rst | Updated reference documentation for the do_quote parameter to include new constraints. |
| changes/unreleased/4818.3VPDqqEWEhDCrTipFY8KKU.toml | Changelog update describing the fixes for do_quote and allow_sending_without_reply handling. |
Comments suppressed due to low confidence (2)
tests/test_message.py:564
- The error message incorrectly prints the actual value twice; it should display the expected value (likely input_chat_id) to help with debugging.
pytest.fail(f"chat_id is {chat_id} but should be {chat_id}")
tests/test_message.py:519
- [nitpick] Consider renaming the variable 'aswr' to a more descriptive name such as 'allow_sending_flag' for improved clarity in the test code.
for aswr in (DEFAULT_NONE, True):
harshil21
reviewed
Jun 17, 2025
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
harshil21
approved these changes
Jun 17, 2025
Member
harshil21
left a comment
There was a problem hiding this comment.
didn't look at the tests too closely, the rest looks fine 👍🏽
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
closes #4807