-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fix Handling of Parameters do_quote
and allow_sending_without_reply
in Message.reply_*
#4818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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):
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't look at the tests too closely, the rest looks fine 👍🏽
closes #4807