⚗️ add ws connection hook

This commit is contained in:
yanyongyu
2020-12-28 13:36:00 +08:00
parent 2d63eb32e1
commit c993f15bca
3 changed files with 92 additions and 5 deletions

View File

@ -54,6 +54,23 @@ T_StateFactory = Callable[["Bot", "Event"], Awaitable[T_State]]
事件处理状态 State 类工厂函数
"""
T_WebSocketConnectionHook = Callable[["Bot"], Awaitable[None]]
"""
:类型: ``Callable[[Bot], Awaitable[None]]``
:说明:
WebSocket 连接建立时执行的函数
"""
T_WebSocketDisconnectionHook = Callable[["Bot"], Awaitable[None]]
"""
:类型: ``Callable[[Bot], Awaitable[None]]``
:说明:
WebSocket 连接断开时执行的函数
"""
T_EventPreProcessor = Callable[["Bot", "Event", T_State], Awaitable[None]]
"""
:类型: ``Callable[[Bot, Event, T_State], Awaitable[None]]``