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

Add global allow sending without reply parameter #913

Closed

Conversation

jonowo
Copy link

@jonowo jonowo commented May 16, 2022

Description

Similar to the global parse_mode and disable_web_page_preview parameters, the global allow_sending_without_reply parameter is added to set a default for allow_sending_without_reply when sending messages.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I cannot add a unit test for this because the returned Message object from Bot.send_message does not indicate if the message was allowed to be sent without a reply.

I created a bot with allow_sending_without_reply=True and it did set the allow_sending_without_reply parameter in its sendMessage request.

Test Configuration:

  • Operating System: Windows 10
  • Python version: Python 3.9.0

3 existing unit tests failed before my changes. There were no extra failed tests after my changes.

============================================================ short test summary info ============================================================
FAILED tests/types/test_chat.py::test_update_chat - AssertionError: assert {'bio': 'bio',\n 'can_set_sticker_set': True,\n 'description': 'desc...
FAILED tests/types/test_message.py::test_export - AssertionError: assert {'chat': {'first_name': 'FirstName',\n          'id': 12345678,\n     ...
FAILED tests/types/test_update.py::test_export - AssertionError: assert {'message': {'chat': {'first_name': 'FirstName',\n                     ...
============================================ 3 failed, 388 passed, 8 skipped, 17 warnings in 17.58s =============================================

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
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (explained above)
  • New and existing unit tests pass locally with my changes (explained above)

@evgfilim1 evgfilim1 added new feature Missing feature 2.x Issue or PR for legacy 2.x version labels May 18, 2022
@bomzheg
Copy link

bomzheg commented Jul 13, 2022

It will be nice to add default parameter to webhook responses, but webhooks responses supports now not all default params.

You can see example about the changes at one similar PR

aiogram/bot/base.py Show resolved Hide resolved
@Olegt0rr Olegt0rr self-requested a review July 14, 2022 10:03
Copy link
Contributor

@Olegt0rr Olegt0rr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add webhook support as mentioned here

@jonowo jonowo closed this Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issue or PR for legacy 2.x version new feature Missing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants