In this commit, a new function `get_mounted_bot` was added to `context_controller.py` that returns the bot mounted in context. This function was needed to bypass the limitation in pydantic BaseModel's properties, which neither support computed fields nor serialization/validation.
Various tests were also updated to compare models using `model_dump_json()` method rather than comparing the models directly. This change provides more accurate comparisons by considering default values in the models.
Further, the dispatcher was adjusted to enforce update re-mounting if the mounted bot differs from the current update. This allows shortcuts to be used in the bot's current instance and ensures the correct propagation of the context to all the nested objects and attributes of Updates.
* 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
* Rewrite filters
* Update README.rst
* Fixed tests
* Small optimization of the Text filter (TY to @bomzheg)
* Remove dataclass slots argument in due to the only Python 3.10 has an slots argument
* Fixed mypy
* Update tests
* Disable Python 3.11
* Fixed#1013: Empty mention should be None instead of empty string.
* Added #990 to the changelog
* Added #942 to the changelog
* Fixed coverage
* Update poetry and dependencies
* Fixed mypy
* Remove deprecated code
* Added more tests, update pyproject.toml
* Partial update docs
* Added initial Docs translation files
* Added more changes
* Added log message when connection is established in polling process
* Fixed action
* Disable lint for PyPy
* Added changelog for docs translation
* Fix the ability to copy the state, now copying the state will return the same state.
* reformat
* full implement deepcopy with memo dict, add typehints
* Update aiogram/dispatcher/fsm/state.py
Co-authored-by: Oleg A. <t0rr@mail.ru>
* update tests
Co-authored-by: Oleg A. <t0rr@mail.ru>
* remove deepcopy in tests
Co-authored-by: Oleg A. <t0rr@mail.ru>
* remove deepcopy method
Co-authored-by: Oleg A. <t0rr@mail.ru>
* update changes description
Co-authored-by: Oleg A. <t0rr@mail.ru>
* update __eq__ method
Co-authored-by: Oleg A. <t0rr@mail.ru>
* add typehints, tests
* return False for not equal objects
creating FilterObject use getfullargspec that check State equality with `type` and `object` builtins, raising Error in `__eq__` method of State break this behavior
* return NotImplemented for other types
* use `!=` instead of 'not x == y' in tests
Co-authored-by: Oleg A. <t0rr@mail.ru>
* 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
* Added base webhook implementation and example
* Added example
* Enable on_startup callback
* Correctly handle response into webhook (silent call)
* Fixed State filter
* Re-generate API
* Added new modules
* Added handling new event type and approve/decline aliases for ChatJoinRequest
* Fixed code-coverage
* Bump API version
* Added patch-notes
* bound filters resolving rework, filters with default argument
* bound filters resolving rework, filters with default argument
* Update 727.misc
* clarification of the comment about skipping filter
* fix data transfer from parent to included routers filters
* fix checking containing value in generator
* Update docs/dispatcher/filters/index.rst
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
* Update 727.misc
* reformat
* better iterable types
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
* 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
* Regenerate API
* Update code
* Fixed command filter for photos
* Fix tests so they are able to run
* Test new and renamed API methods
* Reformat files
* Fix outer_middleware resolution (#637) (#640)
* Fix outer_middleware resolution (#637)
* Reformat files
* Reorder routers when resolve middlewares
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
* Added possibility to use empty callback data factory filter
* Rename KeyboardConstructor to KeyboardBuilder
* Fixed type
Co-authored-by: evgfilim1 <evgfilim1@yandex.ru>