nonebot2/tests/plugins/param/param_arg.py

29 lines
603 B
Python
Raw Normal View History

from typing_extensions import Annotated
from nonebot.adapters import Message
2021-12-23 22:16:55 +08:00
from nonebot.params import Arg, ArgStr, ArgPlainText
2021-12-20 14:31:48 +08:00
async def arg(key: Message = Arg()) -> Message:
return key
async def arg_str(key: str = ArgStr()) -> str:
return key
2021-12-23 22:16:55 +08:00
async def arg_plain_text(key: str = ArgPlainText()) -> str:
2021-12-20 14:31:48 +08:00
return key
async def annotated_arg(key: Annotated[Message, Arg()]) -> Message:
return key
async def annotated_arg_str(key: Annotated[str, ArgStr()]) -> str:
return key
async def annotated_arg_plain_text(key: Annotated[str, ArgPlainText()]) -> str:
return key