Feature: 存储 matcher 发送 prompt 的结果 (#3155)

This commit is contained in:
Ju4tCode
2024-12-05 20:55:24 +08:00
committed by GitHub
parent ab8dea5a02
commit 32bc2c314a
8 changed files with 271 additions and 22 deletions

View File

@ -1,7 +1,7 @@
from typing import Annotated
from typing import Annotated, Any
from nonebot.adapters import Message
from nonebot.params import Arg, ArgPlainText, ArgStr
from nonebot.params import Arg, ArgPlainText, ArgPromptResult, ArgStr
async def arg(key: Message = Arg()) -> Message:
@ -28,6 +28,10 @@ async def annotated_arg_plain_text(key: Annotated[str, ArgPlainText()]) -> str:
return key
async def annotated_arg_prompt_result(key: Annotated[Any, ArgPromptResult()]) -> Any:
return key
# test dependency priority
async def annotated_prior_arg(key: Annotated[str, ArgStr("foo")] = ArgPlainText()):
return key