📝 Docs: 修复依赖注入文档 ArgStr 3.9+ 和 3.8+ 版本代码写反 (#2126)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
eya46 2023-06-25 11:29:10 +08:00 committed by GitHub
parent f1046cfb11
commit 7a3c7476fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View File

@ -1166,8 +1166,8 @@ from typing import Annotated
from nonebot.params import ArgStr
@matcher.got("key")
async def _(key: str = ArgStr()): ...
async def _(foo: str = ArgStr("key")): ...
async def _(key: Annotated[str, ArgStr()]): ...
async def _(foo: Annotated[str, ArgStr("key")]): ...
```
</TabItem>
@ -1177,8 +1177,8 @@ async def _(foo: str = ArgStr("key")): ...
from nonebot.params import ArgStr
@matcher.got("key")
async def _(key: Annotated[str, ArgStr()]): ...
async def _(foo: Annotated[str, ArgStr("key")]): ...
async def _(key: str = ArgStr()): ...
async def _(foo: str = ArgStr("key")): ...
```
</TabItem>

View File

@ -1155,8 +1155,8 @@ from typing import Annotated
from nonebot.params import ArgStr
@matcher.got("key")
async def _(key: str = ArgStr()): ...
async def _(foo: str = ArgStr("key")): ...
async def _(key: Annotated[str, ArgStr()]): ...
async def _(foo: Annotated[str, ArgStr("key")]): ...
```
</TabItem>
@ -1166,8 +1166,8 @@ async def _(foo: str = ArgStr("key")): ...
from nonebot.params import ArgStr
@matcher.got("key")
async def _(key: Annotated[str, ArgStr()]): ...
async def _(foo: Annotated[str, ArgStr("key")]): ...
async def _(key: str = ArgStr()): ...
async def _(foo: str = ArgStr("key")): ...
```
</TabItem>

View File

@ -1139,8 +1139,8 @@ from typing import Annotated
from nonebot.params import ArgStr
@matcher.got("key")
async def _(key: str = ArgStr()): ...
async def _(foo: str = ArgStr("key")): ...
async def _(key: Annotated[str, ArgStr()]): ...
async def _(foo: Annotated[str, ArgStr("key")]): ...
```
</TabItem>
@ -1150,8 +1150,8 @@ async def _(foo: str = ArgStr("key")): ...
from nonebot.params import ArgStr
@matcher.got("key")
async def _(key: Annotated[str, ArgStr()]): ...
async def _(foo: Annotated[str, ArgStr("key")]): ...
async def _(key: str = ArgStr()): ...
async def _(foo: str = ArgStr("key")): ...
```
</TabItem>