🐛 fix command rule type annotation error

This commit is contained in:
yanyongyu 2021-12-25 20:17:12 +08:00
parent d773fea709
commit 00c2ee8490

View File

@ -304,7 +304,7 @@ class CommandRule:
def __init__(self, cmds: List[Tuple[str, ...]]): def __init__(self, cmds: List[Tuple[str, ...]]):
self.cmds = cmds 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 return cmd in self.cmds
def __repr__(self): def __repr__(self):
@ -390,7 +390,7 @@ class ShellCommandRule:
async def __call__( async def __call__(
self, self,
cmd: Tuple[str, ...] = Command(), cmd: Optional[Tuple[str, ...]] = Command(),
msg: Message = EventMessage(), msg: Message = EventMessage(),
state: T_State = State(), state: T_State = State(),
) -> bool: ) -> bool: