Skip to content

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

Merged
merged 9 commits into from
Jun 19, 2025

Conversation

Bibo-Joshi
Copy link
Member

closes #4807

@Bibo-Joshi Bibo-Joshi added the 🔌 bug pr description: bug label Jun 7, 2025
Copy link

@Copilot Copilot AI left a 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>
Copy link
Member

@harshil21 harshil21 left a 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 👍🏽

@Bibo-Joshi Bibo-Joshi merged commit d46ddf7 into master Jun 19, 2025
49 of 50 checks passed
@Bibo-Joshi Bibo-Joshi deleted the fix-aswr-do_quote branch June 19, 2025 18:56
@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔌 bug pr description: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reply_text keyword argument allow_sending_without_reply fails when do_quote is True
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy