* 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
* 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
* Added base support of Bot API 7.2
* Added base support of Bot API 7.2
* Fixing tests and content types for Telegram Bot API 7.2 update (#1453)
* Fixing tests and content types for Telegram Bot API 7.2
* Adding changelog for 1453 PR
* Fixes + coverage
* Replace `BusinessConnection.date` type
* Reformat code
* Refactor UserContextMiddleware to use EventContext class
This update significantly refactors UserContextMiddleware to leverage a new class, EventContext. Instead of resolving event context as a tuple, it now produces an instance of EventContext. Additional adjustments include supporting a business connection ID for event context identification and facilitating backwards compatibility. Tests and other files were also updated accordingly for these changes.
* Cover FSM key builder (business_connection_id
* Added changelog
---------
Co-authored-by: RoLOQ <roman.fedunn@gmail.com>
* Add voter_chat to poll_answer event handling
The change ensures that when a poll_answer event is processed, the user context middleware now also returns the chat where the vote took place. Previously, only the user who cast the vote was returned.
* Added changelog
* Fixed tests
* Bump Python version in test
Three properties of the Bot class - parse_mode, disable_web_page_preview, and protect_content - have been marked as deprecated with proper warning messages. The associated tests have also been added to confirm the working of these deprecation warnings. Users are advised to use the updated alternatives specified in the warning messages.
* #1320 Update pytest configuration and tests cleanup
This commit modifies the pytest's configuration file, `pyproject.toml`, to remove filterwarnings settings. It also makes changes in various test files; the Redis isolation test is now using the provided `redis_storage` fixture instead of setting up its own connection, pytest.mark.filterwarnings is no longer used in `test_isolation.py` and `test_aiohttp_session.py` properly closes off sessions.
* Added changelog
* Fixed coverage for the RedisEventIsolation
* 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
* 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
* 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
Upgrade architecture + 5.0 Bot API (#469)
* Moved `methods`, `types` and `client` to root package
* Removed update handler from routers to dispatcher
* Reworked events propagation mechanism to handlers
* Reworked inner middlewares logic (very small change)
* Updated to Bot API 5.0
* Initial migration from MkDocs to Sphinx + config for readthedocs
* fix(aiohttp-session): respect UNSET sentinel
check if value is `UNSET` while building http request.
* Cover UNSET by tests
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
* feat(helpers): implement new descriptor with default value getter
* perf(descriptor): use weakref
refuse weak reference to a value in WeakRefDict instead of polluting instance namespace
* chore(descriptor): rename descriptor class
rename `DefaultProperty` to `Default`
* style(fmt): lint code
* feat(proxy): proxy for aiohttp,base sessions
Add support for proxies in aiohttp session with aiohttp_socks library,
edit BaseSession class to support proxies for other sessions in future.
* fix(annotation): missing underscore before "private" typevar
* chore: remove redundant of proxy_url schema for socks version
* test: add missing test
Add missing test, remove BaseSession.cfg and switch to
implementing class' "private" traits, add aiohttp_socks in dependency list as
optional and extra.
* feat(session):
Implement asyncio session for requests [wip]
* feat(proxy chain): Chained proxy support in aiohttp session
Add ChainProxyConnector support, !pin pydantic to "1.4", add
documentation on aiohttp connector.
* style(mypy): apply linter changes
* tests(mock): remove await for magic mock
* fix dangling dependency
* refactor(generic):
get rid of generic behaviour for base session