From 00c2ee84907383da909d06a0aa8bdb8928d788ae Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sat, 25 Dec 2021 20:17:12 +0800 Subject: [PATCH] :bug: fix command rule type annotation error --- nonebot/rule.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nonebot/rule.py b/nonebot/rule.py index f127230c..b4cf827c 100644 --- a/nonebot/rule.py +++ b/nonebot/rule.py @@ -304,7 +304,7 @@ class CommandRule: def __init__(self, cmds: List[Tuple[str, ...]]): self.cmds = cmds - async def __call__(self, cmd: Tuple[str, ...] = Command()) -> bool: + async def __call__(self, cmd: Optional[Tuple[str, ...]] = Command()) -> bool: return cmd in self.cmds def __repr__(self): @@ -390,7 +390,7 @@ class ShellCommandRule: async def __call__( self, - cmd: Tuple[str, ...] = Command(), + cmd: Optional[Tuple[str, ...]] = Command(), msg: Message = EventMessage(), state: T_State = State(), ) -> bool: