test matchergroup

This commit is contained in:
yanyongyu
2020-12-04 01:55:03 +08:00
parent 5b42454a55
commit f6806c1d55
5 changed files with 30 additions and 14 deletions

View File

@ -0,0 +1,15 @@
from nonebot.typing import Bot, Event
from . import match
async def heartbeat(bot: Bot, event: Event, state: dict) -> bool:
return event.detail_type == "heartbeat"
test = match.on_metaevent(rule=heartbeat)
@test.receive()
async def handle_heartbeat(bot: Bot, event: Event, state: dict):
print("[i] Heartbeat")