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.
* 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
* ignore_case fix
* Create 1106.bugfix.rst
* better fix, added tests
* Update 1106.bugfix.rst
* fix, attempt to satisfy the linter
* not on purpose, single quotes in tests
* 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>
* 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