⚗️ add type and permission updater hook

This commit is contained in:
yanyongyu
2021-03-03 16:06:19 +08:00
parent 464f0d4a89
commit 9e04e497b7
7 changed files with 200 additions and 29 deletions

View File

@ -212,3 +212,35 @@ sidebarDepth: 0
* **说明**
ArgsParser 即消息参数解析函数,在 Matcher.got 获取参数时被运行。
## `T_TypeUpdater`
* **类型**
`Callable[[Bot, Event, T_State, str], Awaitable[str]]`
* **说明**
TypeUpdater 在 Matcher.pause, Matcher.reject 时被运行,用于更新响应的事件类型。默认会更新为 `message`
## `T_PermissionUpdater`
* **类型**
`Callable[[Bot, Event, T_State, Permission], Awaitable[Permission]]`
* **说明**
PermissionUpdater 在 Matcher.pause, Matcher.reject 时被运行,用于更新会话对象权限。默认会更新为当前事件的触发对象。