mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
fix some bug
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user