From 2e7c86dc23e9500e6660fd52fd1549b47e088f67 Mon Sep 17 00:00:00 2001 From: AsakuraMizu <0xWATERx0@gmail.com> Date: Sun, 23 Aug 2020 20:01:58 +0800 Subject: [PATCH] fix command type --- nonebot/plugin.py | 2 +- nonebot/rule.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nonebot/plugin.py b/nonebot/plugin.py index 63e06793..e49c5775 100644 --- a/nonebot/plugin.py +++ b/nonebot/plugin.py @@ -142,7 +142,7 @@ def on_endswith(msg: str, startswith(msg), permission, **kwargs) -def on_command(cmd: Union[str, Tuple[str]], +def on_command(cmd: Union[str, Tuple[str, ...]], rule: Optional[Union[Rule, RuleChecker]] = None, permission: Permission = Permission(), **kwargs) -> Type[Matcher]: diff --git a/nonebot/rule.py b/nonebot/rule.py index c13e2f1d..39b1ec6f 100644 --- a/nonebot/rule.py +++ b/nonebot/rule.py @@ -105,7 +105,7 @@ def keyword(msg: str) -> Rule: return Rule(_keyword) -def command(command: Tuple[str]) -> Rule: +def command(command: Tuple[str, ...]) -> Rule: config = get_driver().config command_start = config.command_start command_sep = config.command_sep