fix several bugs

This commit is contained in:
yanyongyu
2020-08-24 17:59:36 +08:00
parent 599844d3ca
commit eaa9b98bd9
7 changed files with 53 additions and 22 deletions

View File

@ -22,7 +22,7 @@ def event_preprocessor(func: PreProcessor) -> PreProcessor:
async def _run_matcher(Matcher: Type[Matcher], bot: Bot, event: Event,
state: dict) -> Union[None, NoReturn]:
if datetime.now() > Matcher.expire_time:
if Matcher.expire_time and datetime.now() > Matcher.expire_time:
raise _ExceptionContainer([ExpiredException])
try:
@ -65,8 +65,7 @@ async def handle_event(bot: Bot, event: Event):
return
# Trie Match
if event.type == "message":
_, _ = TrieRule.get_value(bot, event, state)
_, _ = TrieRule.get_value(bot, event, state)
break_flag = False
for priority in sorted(matchers.keys()):