finish typing change

This commit is contained in:
yanyongyu
2020-12-17 21:09:30 +08:00
parent 6bd69e6708
commit 799144e64d
19 changed files with 309 additions and 315 deletions

View File

@ -1,15 +1,16 @@
from nonebot.typing import State
from nonebot.adapters import Bot, Event
from nonebot.typing import T_State
from nonebot.plugin import on_metaevent
from nonebot.adapters import Bot, Event
from nonebot.adapters.cqhttp import HeartbeatMetaEvent
async def heartbeat(bot: Bot, event: Event, state: State) -> bool:
return event.detail_type == "heartbeat"
async def heartbeat(bot: Bot, event: Event, state: T_State) -> bool:
return isinstance(event, HeartbeatMetaEvent)
test_matcher = on_metaevent(heartbeat)
@test_matcher.receive()
async def handle_heartbeat(bot: Bot, event: Event, state: dict):
async def handle_heartbeat(bot: Bot, event: Event, state: T_State):
print("[i] Heartbeat")