* Drop py3.9 and pypy3.9
Add pypy3.11 (testing) into `tests.yml`
Remove py3.9 from matrix in `tests.yml`
Refactor not auto-gen code to be compatible with py3.10+, droping ugly 3.9 annotation.
Replace some `from typing` imports to `from collections.abc`, due to deprecation
Add `from __future__ import annotations` and `if TYPE_CHECKING:` where possible
Add some `noqa` to calm down Ruff in some places, if Ruff will be used as default linting+formatting tool in future
Replace some relative imports to absolute
Sort `__all__` tuples in `__init__.py` and some other `.py` files
Sort `__slots__` tuples in classes
Split raises into `msg` and `raise` (`EM101`, `EM102`) to not duplicate error message in the traceback
Add `Self` from `typing_extenstion` where possible
Resolve typing problem in `aiogram/filters/command.py:18`
Concatenate nested `if` statements
Convert `HandlerContainer` into a dataclass in `aiogram/fsm/scene.py`
Bump tests docker-compose.yml `redis:6-alpine` -> `redis:8-alpine`
Bump tests docker-compose.yml `mongo:7.0.6` -> `mongo:8.0.14`
Bump pre-commit-config `black==24.4.2` -> `black==25.9.0`
Bump pre-commit-config `ruff==0.5.1` -> `ruff==0.13.3`
Update Makefile lint for ruff to show fixes
Add `make outdated` into Makefile
Use `pathlib` instead of `os.path`
Bump `redis[hiredis]>=5.0.1,<5.3.0` -> `redis[hiredis]>=6.2.0,<7`
Bump `cryptography>=43.0.0` -> `cryptography>=46.0.0` due to security reasons
Bump `pytz~=2023.3` -> `pytz~=2025.2`
Bump `pycryptodomex~=3.19.0` -> `pycryptodomex~=3.23.0` due to security reasons
Bump linting and formatting tools
* Add `1726.removal.rst`
* Update aiogram/utils/dataclass.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update aiogram/filters/callback_data.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update 1726.removal.rst
* Remove `outdated` from Makefile
* Add `__slots__` to `HandlerContainer`
* Remove unused imports
* Add `@dataclass` with `slots=True` to `HandlerContainer`
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Added "startapp" deep link support
* Remove link_type param, added create_startapp_link method
* Write tests for create_startapp_link method
* Refactor with black & isort
* Added CHANGELOG
* Added support of direct mini app links
* Added CHANGELOG
* Added "startapp" deep link support
* Remove link_type param, added create_startapp_link method
* Write tests for create_startapp_link method
* Refactor with black & isort
* Added CHANGELOG
* Fix handler registration order in `Scene`
Previously, `Scene` handlers were registered based on the sorted output of `inspect.getmembers`, causing incorrect execution order. Now, handlers are registered in the order they are defined in the class, ensuring reliable behavior and proper sequence when handling filters with varying specificity. Added test cases to validate the correct handler ordering.
* Add dynamic dataclass and class attribute resolvers
Introduced `dataclass_kwargs` to ensure compatibility with different Python versions and modular attribute handling. Added utilities for resolving class attributes dynamically, enhancing flexibility with MRO-based resolvers. Updated tests to verify new features and ensure proper functionality across various scenarios.
* Update changelog
* Try to enable tests on Python 3.13
* Remove support for Python 3.8 and PyPy 3.8
Dropped Python 3.8 and PyPy 3.8 from the CI workflow and updated the minimum required Python version to 3.9 in pyproject.toml. Also updated dependencies and tools to align with the new minimum Python version.
* Added changelog
* Reformat code
* Bump mypy python version
* Add serialization utilities and update documentation
Introduced utilities to deserialize Telegram objects to JSON-compliant Python objects and vice versa. These utilities manage both cases with and without files. The documentation has been updated to reflect these changes, including updates in migration recommendations and tutorials. A new unit test is added to verify the new functionality.
* Fixed Must-die implementation of the datetime serialization
* Fixed `TypeError: can't subtract offset-naive and offset-aware datetimes`
* Add missing Telegram WebApp API classes and fields (#1424)
* Implemented `WebAppChat` class with fields `id`, `type`, `title`, `username`, and `photo_url` as per Telegram documentation.
* Modified `WebAppUser` class by adding `is_premium`, `added_to_attachment_menu`, and `allows_write_to_pm` fields.
* Modified `WebAppInitData` class to include `chat`, `chat_type`, `chat_instance` fields for full API support.
* fix changelog file name
* fix line too long
* 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>
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
Modified the ".as_" method in the magic filter class to correctly handle values that are interpreted as `False` such as `0`. Previously, the method incorrectly dismissed these valid values. The issue was identified and fixed to ensure correct handling of all valid data inputs.
* Add support for message_thread_id in ChatActionSender
The given changes add support for including the 'message_thread_id' in ChatActionSender function calls, allowing actions to be sent in specific threads rather than the main chat.
* Added changelog
* Enhance keyboard utility, improved documentation for this utility.
Updated the 'aiogram/utils/keyboard.py' file with new methods for integrating buttons and keyboard creation more seamlessly. Added functionality to create buttons from existing markup and attach another builder. This improvement aims to make the keyboard building process more user-friendly and flexible.
* Added changelog
* Cover by tests
* Removed the use of the context instance (Bot.get_current) from all placements that were used previously.
* Fixed tests
* Added changelog
* Change category
* Rework middlewares, separate management to `MiddlewareManager` class
* Rework middlewares
* Added changes description for redis
* Added changes description for redis
* Fixed tests with Redis // aioredis replacement
* Changed msg.<html/md>_text attributes behaviour
* Added changelog for spoilers
* Added possibility to get command magic result as handler arguments
* Update API, added some new features
* Fixed unknown chat_action value
* Separate events from dispatcher messages
* Disabled cache for I18n LazyProxy
* Rework events isolation
* Added chat member status changed filter, update Bot API 5.7, other small changes
* Improve exceptions in chat member status filter
* Fixed tests, covered flags and events isolation modules
* Try to fix flake8 unused type ignore
* Fixed linter error
* Cover chat member updated filter
* Cover chat action sender
* Added docs for chat action util
* Try to fix tests for python <= 3.9
* Fixed headers
* Added docs for flags functionality
* Added docs for chat_member_updated filter
* Added change notes
* Update dependencies and fix mypy checks
* Bump version
* Try to test on Python 3.10
* Prevent to YAML type cast
* Bump poetry
* Removed async_lru
* Disable fail-fast on tests
* Fixed typing
* Added patch-notes