fix some bug

This commit is contained in:
yanyongyu
2020-08-23 10:45:26 +08:00
parent 87a848d8c3
commit a895089a8b
8 changed files with 39 additions and 18 deletions

View File

@ -142,10 +142,12 @@ def on_endswith(msg: str,
startswith(msg), permission, **kwargs)
def on_command(cmd: Tuple[str],
def on_command(cmd: Union[str, Tuple[str]],
rule: Optional[Union[Rule, RuleChecker]] = None,
permission: Permission = Permission(),
**kwargs) -> Type[Matcher]:
if isinstance(cmd, str):
cmd = (cmd,)
return on_message(command(cmd) &
rule, permission, **kwargs) if rule else on_message(
command(cmd), permission, **kwargs)