mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 17:15:05 +08:00
16 lines
325 B
Python
16 lines
325 B
Python
|
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")
|