🔀 Merge pull request #70

Fix: running expired matcher
This commit is contained in:
Ju4tCode 2020-11-19 22:08:31 +08:00 committed by GitHub
commit 93ee9a3b58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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