mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
⚡Support shell-like command
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import re
|
||||
from argparse import ArgumentParser
|
||||
from types import ModuleType
|
||||
from contextvars import ContextVar
|
||||
from typing import Any, Set, List, Dict, Type, Tuple, Union, Optional
|
||||
@ -146,6 +147,15 @@ def on_command(cmd: Union[str, Tuple[str, ...]],
|
||||
...
|
||||
|
||||
|
||||
def on_shell_like_command(cmd: Union[str, Tuple[str, ...]],
|
||||
rule: Optional[Union[Rule, T_RuleChecker]] = None,
|
||||
aliases: Optional[Set[Union[str,
|
||||
Tuple[str, ...]]]] = None,
|
||||
shell_like_argsparser: Optional[ArgumentParser] = None,
|
||||
**kwargs) -> Type[Matcher]:
|
||||
...
|
||||
|
||||
|
||||
def on_regex(pattern: str,
|
||||
flags: Union[int, re.RegexFlag] = 0,
|
||||
rule: Optional[Rule] = ...,
|
||||
|
Reference in New Issue
Block a user