Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 11 commits into from
Jun 25, 2023
8 changes: 4 additions & 4 deletions website/docs/advanced/dependency.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
8 changes: 4 additions & 4 deletions website/versioned_docs/version-2.0.0/advanced/dependency.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down