From 1d9f026e0710d344b8e07c43269c14b38c3c0616 Mon Sep 17 00:00:00 2001 From: JRoot Junior Date: Sun, 2 Mar 2025 01:19:41 +0200 Subject: [PATCH] Typo fixes --- docs/dispatcher/dependency_injection.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/dispatcher/dependency_injection.rst b/docs/dispatcher/dependency_injection.rst index 562c4da1..3c6a3821 100644 --- a/docs/dispatcher/dependency_injection.rst +++ b/docs/dispatcher/dependency_injection.rst @@ -105,14 +105,14 @@ Example of using type hints: class MyMessageMiddleware(BaseMiddleware): async def __call__( self, - handler: Callable[[Message, MiddlewareData], Awaitable[Any]], + handler: Callable[[Message, MyMiddlewareData], Awaitable[Any]], event: Message, - data: MiddlewareData, + data: MyMiddlewareData, ) -> Any: bot = data["bot"] # <-- IDE will show you that data has `bot` key and its type is `Bot` - data["my_custom_value"] = 42 # <-- IDE will show you that you can set `my_custom_value` key with int value and warn you if you try to set it with other type - return await handler(event, data)) + data["my_custom_value"] = bot.id * 42 # <-- IDE will show you that you can set `my_custom_value` key with int value and warn you if you try to set it with other type + return await handler(event, data) Available context data type helpers