🚑 fix matcher check

This commit is contained in:
yanyongyu 2020-11-19 23:18:03 +08:00 committed by pull[bot]
parent 17747f94c8
commit d55459cfcd

View File

@ -92,7 +92,7 @@ async def _check_matcher(priority: int, bot: Bot, event: Event,
async def _check(Matcher: Type[Matcher], bot: Bot, event: Event, async def _check(Matcher: Type[Matcher], bot: Bot, event: Event,
state: dict) -> Optional[Type[Matcher]]: state: dict) -> Optional[Type[Matcher]]:
try: try:
if (Matcher.expire_time and datetime.now() <= Matcher.expire_time if (not Matcher.expire_time or datetime.now() <= Matcher.expire_time
) and await Matcher.check_perm( ) and await Matcher.check_perm(
bot, event) and await Matcher.check_rule(bot, event, state): bot, event) and await Matcher.check_rule(bot, event, state):
return Matcher return Matcher