* Remove deprecated attributes from Bot class
The deprecated attributes `parse_mode`, `disable_web_page_preview`, and `protect_content` have been removed from the Bot class. Additionally, the associated warnings and test cases have been deleted. These attributes should now be passed using the `default=DefaultBotProperties(...)` syntax instead.
* Added docs and changelog
* Add context manager support for bot client
The bot client now supports the context manager protocol, providing automatic resource management. This enhancement helps to automatically close the session when leaving the context, which cleans up resources better. The documentation and tests have been updated accordingly to illustrate this new feature. Moreover, an example of usage without a dispatcher has been provided to clarify its use in simple cases.
* Added changelog
* Added base support of Bot API 7.2
* Added base support of Bot API 7.2
* Fixing tests and content types for Telegram Bot API 7.2 update (#1453)
* Fixing tests and content types for Telegram Bot API 7.2
* Adding changelog for 1453 PR
* Fixes + coverage
* Replace `BusinessConnection.date` type
* Reformat code
* Refactor UserContextMiddleware to use EventContext class
This update significantly refactors UserContextMiddleware to leverage a new class, EventContext. Instead of resolving event context as a tuple, it now produces an instance of EventContext. Additional adjustments include supporting a business connection ID for event context identification and facilitating backwards compatibility. Tests and other files were also updated accordingly for these changes.
* Cover FSM key builder (business_connection_id
* Added changelog
---------
Co-authored-by: RoLOQ <roman.fedunn@gmail.com>
* Add voter_chat to poll_answer event handling
The change ensures that when a poll_answer event is processed, the user context middleware now also returns the chat where the vote took place. Previously, only the user who cast the vote was returned.
* Added changelog
* Fixed tests
* Bump Python version in test
Three properties of the Bot class - parse_mode, disable_web_page_preview, and protect_content - have been marked as deprecated with proper warning messages. The associated tests have also been added to confirm the working of these deprecation warnings. Users are advised to use the updated alternatives specified in the warning messages.
* Added support for Bot API 7.0
* Fixed available tests
* Fixed text decorations
* Bot API 7.0 tests for ForwardMessages
* Bot API 7.0 tests for CopyMessages
* Bot API 7.0 tests for DeleteMessages
* Bot API 7.0 tests for GetUserChatBoosts
* Bot API 7.0 tests for SetMessageReaction
* Fixed custom_emoji attribute name
* Fixed tests
* Test parsing CallbackQuery message (inaccessible and accessible)
* Added changes description
* Bot API 7.0 tests for dispatcher handle update message_reaction
* Bot API 7.0 tests for dispatcher handle update message_reaction_count
* Bot API 7.0 tests for dispatcher handle update chat_boost
* Bot API 7.0 tests for dispatcher handle update removed_chat_boost
* fix tests: update ReactionTypeCustomEmoji custom_emoji -> custom_emoji_id
* micro fix Markdown V2 blockquote
* add tests for Markdown tools
* fix markdown test apply single entity
* add tests coverage for Message.react
* check that all messages and content types are covered for Message.content_type
* sort imports in tests (run `make reformat lint`)
* update Giveaway objects Unix time field to DateTime type
* Update Message.content_type property
* upgrade tests for message content_types and sent_copy
* Update Giveaway type generation config
* Update GiveawayWinners and PassportFile types generation configs
---------
Co-authored-by: Suren Khorenyan <surenkhorenyan@gmail.com>
* #1320 Update pytest configuration and tests cleanup
This commit modifies the pytest's configuration file, `pyproject.toml`, to remove filterwarnings settings. It also makes changes in various test files; the Redis isolation test is now using the provided `redis_storage` fixture instead of setting up its own connection, pytest.mark.filterwarnings is no longer used in `test_isolation.py` and `test_aiohttp_session.py` properly closes off sessions.
* Added changelog
* Fixed coverage for the RedisEventIsolation
* Add current handler to filters, so that flags can be retrieved from it.
* run black isort
* add changelog
* Update CHANGES/1360.bugfix.rst
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
---------
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
Implemented a MediaGroupBuilder class in 'aiogram/utils/media_group.py' to help construct media groups. The class supports addition of different media types (audio, photo, video, document) to the media group with a maximum limit of 10 files. The functionality is demonstrated and usage is documented in 'docs/utils/media_group.rst'. Added related test cases in 'tests/test_utils/test_media_group.py'. This is to streamline and simplify the process of media group creation
* Ensure base type validation can handle non-dictionary values
The update introduces a condition to verify whether the values being validated are a dictionary before attempting to handle UNSET_TYPE in the aiogram base type. This adjustment helps to prevent potential errors or incorrect validation when non-dictionary values are faced.
* Added a test case for non-dictionary input in remove_unset method
* Added changelog
* Fixed tests
* Fix `Message.send_copy` method for stories
Fixed an issue with the `Message.send_copy` method, which was not functioning properly with story-type messages. The `ForwardMessage` logic has been added to the method to enable copying of stories, in addition to other types. Tests and documentation have also been updated to reflect these changes.
* Typo fix
* Add additional API message methods to ChatJoinRequest class
ChatJoinRequest now includes additional message methods including SendAnimation, SendAudio, SendContact, and many more. The changes are useful for sending various types of messages during chat join requests.
* Added changelog
* PoC: Mount objects to the Bot instance, bind shortcuts to configured instance
* Fixe docstring of the bind method
* Pass Bot instance explicitly to the URLInputFile
* Added tests
* Added changelog
* Refactor aiogram client and update tests
Refactored base.py to improve code readability by separating response_type operation from model_validate(). Also, adjusted the parameters in URLInputFile() within test_input_file.py for better test coverage. Updated input_file.py to streamline read method and avoid unnecessary instantiation of Bot class. Lastly, adjusted typing in methods/base.py to enhance code clarity.
* Update changelog
* Added missing FORUM_TOPIC_EDITED value to content_type property
* Added changelog to CHANGES
* Fixed aiogram/filters/magic_data.py:21:41: C416 Unnecessary `dict` comprehension (rewrite using `dict()`)
* Resolve #1155: Different signature of startup/shutdown events on polling and webhooks (#1156)
* Code refactor
- Use 'or' istead of 'A if A else B'
- Raise new error from catched error: raise Error from e
* Fixed signature of startup/shutdown events
- Include the **dispatcher.workflow_data as the handler arguments
* Update deep_linking basic examples (#1151)
* skip if current router does not have observer for custom event (#1147)
* skip if current router does not have observer for custom event
* Test custom event in router
* Feature changelog file
* fix style
* Change `InlineQueryResultType.MPEG` to more correct (#1146)
* Change `InlineQueryResultType.MPEG` to `InlineQueryResultType.MPEG4GIF`
* Change regexp for parse entities
* Use code generator to fix types
* Add changelog
* fix(docs): fix wrong page link in docs (#1154)
* storage cleanup (#1144)
* storage cleanup
* storage cleanup
* Update API docs
* Added tests
* Fix tests
---------
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
Co-authored-by: Łukasz Tshipenchko <dev@zxc.sx>
Co-authored-by: Max Kotsiuruba <81016938+A5KET@users.noreply.github.com>
Co-authored-by: Andrey Tikhonov <andrey.tikhonov@quantori.com>
Co-authored-by: Desiders <47452083+Desiders@users.noreply.github.com>
Co-authored-by: Daniil <hum4noid@yandex.ru>
Co-authored-by: RootShinobi <111008396+RootShinobi@users.noreply.github.com>
* Check status code when downloading file and raise an error if someting bad happends
* Style fixes
* Add doc
* Use "towncrier create <issue>.<type>" for creating file
* Added full support of Bot API 6.5
* Shut up, linters (Fixed errors)
* Oops. Added lost files.
* Fixed tests
* Added changes description
* Update description from docs
* Fixed anchors
* Update Butcher
* Added danger zone to changelog
* Type
* add new method
* Create 1049.feature.rst
* update test_user
* after black and isort using
* after black and isort using
* adding new tests
* fix test
* update tests
* update test
* using create_tg_link function instead of new func
* Update user.py
* Update aiogram/types/user.py
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>