mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
⚗️ add type and permission updater hook
This commit is contained in:
@ -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 时被运行,用于更新会话对象权限。默认会更新为当前事件的触发对象。
|
||||
|
Reference in New Issue
Block a user