Skip to content
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

Fix send_copy helper parse mode #1332

Merged

Conversation

mahenzon
Copy link
Contributor

@mahenzon mahenzon commented Oct 8, 2023

Description

If you set default parse mode on Bot instance, this parse mode applies on all calls with UNSET parse mode, even on send_copy, where entities are already applied and no parse mode is required. It even breaks copying regular messages with 'special' characters like . or ! when MarkdownV2 is set by default.
Parse mode should not be sent, but we need to have an option to override it. So, by default parse_mode in send_copy should be `None.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Added autotests
  • Created a Bot instance with default parse_mode = MarkdownV2

Test Configuration:

  • Operating System: macOS
  • Python version: 3.11

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@github-actions github-actions bot added the 3.x Issue or PR for stable 3.x version label Oct 8, 2023
@github-actions
Copy link

github-actions bot commented Oct 8, 2023

✔️ Changelog found.

Thank you for adding a description of the changes

@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

Merging #1332 (05531e4) into dev-3.x (6738255) will not change coverage.
Report is 2 commits behind head on dev-3.x.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           dev-3.x     #1332   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          369       369           
  Lines         9429      9435    +6     
=========================================
+ Hits          9429      9435    +6     
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
aiogram/types/message.py 100.00% <ø> (ø)

... and 2 files with indirect coverage changes

@JrooTJunior JrooTJunior merged commit 564292d into aiogram:dev-3.x Oct 8, 2023
22 checks passed
@mahenzon mahenzon deleted the fix-send_copy-helper-parse-mode branch October 8, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issue or PR for stable 3.x version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants