diff --git a/archive/2.0.0a8.post2/guide/creating-a-matcher.md b/archive/2.0.0a8.post2/guide/creating-a-matcher.md index 182885fe..ac74f6c1 100644 --- a/archive/2.0.0a8.post2/guide/creating-a-matcher.md +++ b/archive/2.0.0a8.post2/guide/creating-a-matcher.md @@ -128,7 +128,7 @@ def check(arg1, args2): async def _checker(bot: Bot, event: Event, state: T_State) -> bool: return bool(arg1 + arg2) - return Rule(_check) + return Rule(_checker) ``` `Rule` 和 `RuleChecker` 之间可以使用 `与 &` 互相组合: diff --git a/docs/api/adapters/README.md b/docs/api/adapters/README.md index 96638ad5..42498ab2 100644 --- a/docs/api/adapters/README.md +++ b/docs/api/adapters/README.md @@ -17,21 +17,25 @@ sidebarDepth: 0 Bot 基类。用于处理上报消息,并提供 API 调用接口。 -### _abstract_ `__init__(driver, connection_type, config, self_id, *, websocket=None)` +### `driver` + +Driver 对象 + + +### `config` + +Config 配置对象 + + +### _abstract_ `__init__(connection_type, self_id, *, websocket=None)` * **参数** - * `driver: Driver`: Driver 对象 - - * `connection_type: str`: http 或者 websocket - * `config: Config`: Config 对象 - - * `self_id: str`: 机器人 ID @@ -39,21 +43,11 @@ Bot 基类。用于处理上报消息,并提供 API 调用接口。 -### `driver` - -Driver 对象 - - ### `connection_type` 连接类型 -### `config` - -Config 配置对象 - - ### `self_id` 机器人 ID @@ -69,6 +63,15 @@ Websocket 连接对象 Adapter 类型 +### _classmethod_ `register(driver, config)` + + +* **说明** + + register 方法会在 driver.register_adapter 时被调用,用于初始化相关配置 + + + ### _abstract async classmethod_ `check_permission(driver, connection_type, headers, body)` diff --git a/docs/api/drivers/README.md b/docs/api/drivers/README.md index 313717cb..77485ed2 100644 --- a/docs/api/drivers/README.md +++ b/docs/api/drivers/README.md @@ -120,7 +120,7 @@ Driver 基类。将后端框架封装,以满足适配器使用。 -### _classmethod_ `register_adapter(name, adapter)` +### `register_adapter(name, adapter)` * **说明** diff --git a/docs/guide/creating-a-matcher.md b/docs/guide/creating-a-matcher.md index 182885fe..ac74f6c1 100644 --- a/docs/guide/creating-a-matcher.md +++ b/docs/guide/creating-a-matcher.md @@ -128,7 +128,7 @@ def check(arg1, args2): async def _checker(bot: Bot, event: Event, state: T_State) -> bool: return bool(arg1 + arg2) - return Rule(_check) + return Rule(_checker) ``` `Rule` 和 `RuleChecker` 之间可以使用 `与 &` 互相组合: