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. |
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):