mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 07:39:45 +08:00
15 lines
349 B
Python
15 lines
349 B
Python
from nonebot.typing import Bot, Event
|
|
from nonebot.plugin import on_metaevent
|
|
|
|
|
|
async def heartbeat(bot: Bot, event: Event, state: dict) -> bool:
|
|
return event.detail_type == "heartbeat"
|
|
|
|
|
|
test_matcher = on_metaevent(heartbeat)
|
|
|
|
|
|
@test_matcher.receive()
|
|
async def handle_heartbeat(bot: Bot, event: Event, state: dict):
|
|
print("[i] Heartbeat")
|