mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 07:39:45 +08:00
📝 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:
parent
f1046cfb11
commit
7a3c7476fb
@ -1166,8 +1166,8 @@ from typing import Annotated
|
|||||||
from nonebot.params import ArgStr
|
from nonebot.params import ArgStr
|
||||||
|
|
||||||
@matcher.got("key")
|
@matcher.got("key")
|
||||||
async def _(key: str = ArgStr()): ...
|
async def _(key: Annotated[str, ArgStr()]): ...
|
||||||
async def _(foo: str = ArgStr("key")): ...
|
async def _(foo: Annotated[str, ArgStr("key")]): ...
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@ -1177,8 +1177,8 @@ async def _(foo: str = ArgStr("key")): ...
|
|||||||
from nonebot.params import ArgStr
|
from nonebot.params import ArgStr
|
||||||
|
|
||||||
@matcher.got("key")
|
@matcher.got("key")
|
||||||
async def _(key: Annotated[str, ArgStr()]): ...
|
async def _(key: str = ArgStr()): ...
|
||||||
async def _(foo: Annotated[str, ArgStr("key")]): ...
|
async def _(foo: str = ArgStr("key")): ...
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
@ -1155,8 +1155,8 @@ from typing import Annotated
|
|||||||
from nonebot.params import ArgStr
|
from nonebot.params import ArgStr
|
||||||
|
|
||||||
@matcher.got("key")
|
@matcher.got("key")
|
||||||
async def _(key: str = ArgStr()): ...
|
async def _(key: Annotated[str, ArgStr()]): ...
|
||||||
async def _(foo: str = ArgStr("key")): ...
|
async def _(foo: Annotated[str, ArgStr("key")]): ...
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@ -1166,8 +1166,8 @@ async def _(foo: str = ArgStr("key")): ...
|
|||||||
from nonebot.params import ArgStr
|
from nonebot.params import ArgStr
|
||||||
|
|
||||||
@matcher.got("key")
|
@matcher.got("key")
|
||||||
async def _(key: Annotated[str, ArgStr()]): ...
|
async def _(key: str = ArgStr()): ...
|
||||||
async def _(foo: Annotated[str, ArgStr("key")]): ...
|
async def _(foo: str = ArgStr("key")): ...
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
@ -1139,8 +1139,8 @@ from typing import Annotated
|
|||||||
from nonebot.params import ArgStr
|
from nonebot.params import ArgStr
|
||||||
|
|
||||||
@matcher.got("key")
|
@matcher.got("key")
|
||||||
async def _(key: str = ArgStr()): ...
|
async def _(key: Annotated[str, ArgStr()]): ...
|
||||||
async def _(foo: str = ArgStr("key")): ...
|
async def _(foo: Annotated[str, ArgStr("key")]): ...
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@ -1150,8 +1150,8 @@ async def _(foo: str = ArgStr("key")): ...
|
|||||||
from nonebot.params import ArgStr
|
from nonebot.params import ArgStr
|
||||||
|
|
||||||
@matcher.got("key")
|
@matcher.got("key")
|
||||||
async def _(key: Annotated[str, ArgStr()]): ...
|
async def _(key: str = ArgStr()): ...
|
||||||
async def _(foo: Annotated[str, ArgStr("key")]): ...
|
async def _(foo: str = ArgStr("key")): ...
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
Loading…
Reference in New Issue
Block a user