nonebot2/tests/test_plugins/test_group/matches.py
2020-12-07 00:06:09 +08:00

17 lines
362 B
Python

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