add state factory support #113

This commit is contained in:
yanyongyu
2020-12-20 11:59:23 +08:00
parent 168cc3801a
commit 1b00fe7921
4 changed files with 239 additions and 164 deletions

View File

@ -43,6 +43,14 @@ T_State = Dict[Any, Any]
事件处理状态 State 类型
"""
T_StateFactory = Callable[["Bot", "Event"], Awaitable[T_State]]
"""
:类型: ``Callable[[Bot, Event], Awaitable[T_State]]``
:说明:
事件处理状态 State 类工厂函数
"""
T_EventPreProcessor = Callable[["Bot", "Event", T_State], Awaitable[None]]
"""