nonebot2/tests/plugins/matcher/matcher_expire.py
Dobiichi-Origami c03b0c73cb
Feature: on_x 支持 expire_time 参数 (#1106)
Co-authored-by: Dobiichi-Origami <454470535@qq.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: yanyongyu <42488585+yanyongyu@users.noreply.github.com>
2022-07-20 10:21:31 +08:00

8 lines
282 B
Python

from datetime import datetime, timedelta
from nonebot.matcher import Matcher
test_temp_matcher = Matcher.new("test", temp=True)
test_datetime_matcher = Matcher.new("test", expire_time=datetime.now())
test_timedelta_matcher = Matcher.new("test", expire_time=timedelta(seconds=-1))