This update will break backward compability with Python 3.6 and works only with Python 3.7+:
- contextvars (PEP-567);
- New syntax for annotations (PEP-563).
Changelog
- Used contextvars instead of
aiogram.utils.context
; - Implemented filters factory;
- Implemented new filters mechanism;
- Allowed to customize command prefix in CommandsFilter;
- Implemented mechanism of passing results from filters (as dicts) as kwargs in handlers (like fixtures in pytest);
- Implemented states group feature;
- Implemented FSM storage's proxy;
- Changed files uploading mechanism;
- Implemented pipe for uploading files from URL;
- Implemented I18n Middleware;
- Errors handlers now should accept only two arguments (current update and exception);
- Used
aiohttp_socks
instead ofaiosocksy
for Socks4/5 proxy; types.ContentType
was divided totypes.ContentType
andtypes.ContentTypes
;- Allowed to use rapidjson instead of ujson/json;
.current()
method in bot and dispatcher objects was renamed toget_current()
;
Full changelog
You can read more details about this release in migration FAQ: https://aiogram.readthedocs.io/en/latest/migration_1_to_2.html