🔀 Merge pull request #158

fix doc typo
This commit is contained in:
Ju4tCode 2021-01-21 11:17:51 +08:00 committed by GitHub
commit 30132e21e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 20 deletions

View File

@ -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` 之间可以使用 `与 &` 互相组合:

View File

@ -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)`

View File

@ -120,7 +120,7 @@ Driver 基类。将后端框架封装,以满足适配器使用。
### _classmethod_ `register_adapter(name, adapter)`
### `register_adapter(name, adapter)`
* **说明**

View File

@ -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` 之间可以使用 `与 &` 互相组合: