Feature: 支持 re.Match 依赖注入 (#1950)

This commit is contained in:
Ju4tCode
2023-04-27 21:58:56 +08:00
committed by GitHub
parent 6691f6ef70
commit 93b79ddcb3
6 changed files with 33 additions and 63 deletions

View File

@ -1,4 +1,4 @@
from typing import List, Tuple
from typing import List, Match, Tuple
from nonebot.typing import T_State
from nonebot.adapters import Message
@ -73,12 +73,12 @@ async def regex_group(regex_group: Tuple = RegexGroup()) -> Tuple:
return regex_group
async def regex_matched(regex_matched: str = RegexMatched()) -> str:
async def regex_matched(regex_matched: Match[str] = RegexMatched()) -> Match[str]:
return regex_matched
async def regex_str(regex_matched: str = RegexStr()) -> str:
return regex_matched
async def regex_str(regex_str: str = RegexStr()) -> str:
return regex_str
async def startswith(startswith: str = Startswith()) -> str: