mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Typo fixes
This commit is contained in:
parent
023918cacc
commit
1d9f026e07
1 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue