From de0bca5c51fde600c3ee6db34dee399bd646b4b9 Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Wed, 20 Jan 2021 23:42:48 +0000 Subject: [PATCH] :memo: update api docs --- docs/api/adapters/README.md | 37 ++++++++++++++++++++----------------- docs/api/drivers/README.md | 2 +- 2 files changed, 21 insertions(+), 18 deletions(-) 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)` * **说明**