* 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
* #1583 Improved Scene handler and action inheritance mechanism
Enhanced the inheritance of handlers and actions in scenes. Refactored to eliminate the copying of previously connected handlers and actions from parent scenes. Now, handlers are dynamically rebuilt based on the current class, properly utilizing class inheritance and enabling handler overrides.
* Added more tests
* Added more tests for non-function handlers
Add new version details to CHANGES.rst and update __meta__.py. Removed individual CHANGES/* feature and bugfix files, merging their content into the main CHANGES.rst.
* #1579 Fixed `Default` object annotation resolution in `pydantic` models. Reformat code.
* Bump mongo and Redis dependencies
* Update pydantic version constraints based on Python version
Adjusted the version constraints for the pydantic library in `pyproject.toml` to ensure compatibility with different Python versions. This helps maintain stability and compatibility across various development environments.
* Adjust version
* Fixed typo
* feature: add aliases for InaccessibleMessage type
* add changelog
* fix changelog
* remove methods that may not be accessible for the InaccessibleMessage type, add tests
* apply black isort
* update docs with InaccessibleMessage aliases
* Bump to the latest schema
* Added full support ob Bot API 7.10
* Add support for purchased paid media events
Enhanced the router to include `purchased_paid_media` handling. Added corresponding test cases to verify the new functionality and updated middleware to return the appropriate `EventContext`.
* Added changelog
* #1543 Fixed link preview options to use global defaults
Refactor various classes to use global defaults for `link_preview_options`. This change ensures consistency and enhances flexibility in handling link preview options across different components.
* Added changelog
* Added message_thread_id to url of chats with topics for message.get_url() (#1451)
* Added tests for message.get_url()
* Added tests for message.get_url()
* Changed tests for message.get_url()
* Added full support of Bot API 7.8
* Added changelog
* Try to fix tests on Windows
* scope=session?
* Try another way
* Just try to set custom event loop policy manually
* Revert "Just try to set custom event loop policy manually"
This reverts commit 04ee60d878.
* Just try to set custom event loop policy manually
* Fix url in button
* Fixed URL path in the "Open" button at the `demo/sendMessage` endpoint
* Fix web_app example
* Add changelog
* Restore old changelog
* Added 'as_reply_parameters' method & integrate with message reply methods
The 'as_reply_parameters' method is added to generate reply parameters in a message. This method was used in reply methods.
* Added changelog
* #1520 Fixed event context resolving for the callback query that is coming from the business account
* Simplify some conditions
* Added changelog
* Fixed AttributeError
* 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 DNS cache ttl setting to aiohttp session.
Also the limit argument is added to the session initializer.
This commit adds a setting for DNS cache ttl (time-to-live) to the aiohttp session configuration. This is implemented as a workaround for a known issue in aiogram as exhibited in aiogram/aiogram#1500.
* Added changelog
* Smaller timeout for MongoStorage connection
By default serverSelectionTimeoutMS=30000. This is too much
* Correct ConnectionError for RedisStorage in tests
* Remove unused import in conftest.py
* Refactor skipping redis and mongo tests
* Fail redis and mongo tests if incorrect URI
If incorrect URIs provided to "--redis" and/or "--mongo" options
tests should fail with ERRORs instead of skipping.
Otherwise the next scenario is possible:
1) developer breaks RedisStorage and/or MongoStorage code
2) tests are run with incorrect redis and/or mongo URIs
provided by "--redis" and "--mongo" options.
For example, wrong port specified.
3) tests pass because skipping doesn't fail tests run
4) developer or reviewer doesn't notice
that redis and/or mongo tests were skipped
5) broken code gets in codebase
* Remove unused fixtures passing in storages tests
* Define create_storage_key fixture in conftest.py
* Linters formatting
* Changes description
* Revert "Smaller timeout for MongoStorage connection"
This reverts commit d88b7ec612.
* Smaller timeout for MongoStorage connection in tests
The default 30s timeout is too long
* Add test for MongoStorage for 100% coverage
* Linters formatting
* Move skipping redis/mongo tests in earlier fixtures
* Replace vars with constants in conftest.py
* Linters formatting
* Add MongoDB dependency to ReadTheDocs configuration
An update has been made to the ReadTheDocs configuration file to include MongoDB as an additional dependency on installation. This change addresses issues with the MongoStorage section in the documentation.
* Rename changelog file
* 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
* Mongo storage included to storages test
* Added few additional checks in storages test
* Added MongoStorage for FSM
* Added changes description
* Fixed error message syntax
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
* Resolved mypy check error
* IF/ELSE statement simplified
* Fix ruff linter error: RET505 Unnecessary `elif` after `return` statement
* Fix ruff linter error: E501 Line too long (100 > 99)
* Added mongo storage testing in CI
* Refactoring while review
* Refactoring while review
* Storing FSM state and data together in MongoDB-storage
* Fix CI - MongoDB container action is only supported on Linux
* Refactoring while review
* Enable Macos in pypy-tests section of CI
* Refactoring while review
* Makefile updated
* redis and mongo storages tests do not run in pypy-tests job of CI
* Fix docstring of DefaultKeyBuilder
---------
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
* 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