✏️ fix docstring typo

This commit is contained in:
yanyongyu
2020-11-30 12:43:44 +08:00
parent e5463cc564
commit 0775a232ce
4 changed files with 153 additions and 117 deletions

View File

@ -24,14 +24,16 @@ NoneBot 使用 [pydantic](https://pydantic-docs.helpmanual.io/) 以及 [python-d
### `environment`
* 类型: `str`
* **类型**: `str`
* 默认值: `"prod"`
* **默认值**: `"prod"`
* 说明:
当前环境名。 NoneBot 将从 `.env.{environment}` 文件中加载配置。
* **说明**
当前环境名。 NoneBot 将从 `.env.{environment}` 文件中加载配置。
## _class_ `Config`
@ -47,69 +49,80 @@ NoneBot 主要配置。大小写不敏感。
### `driver`
* 类型: `str`
* **类型**: `str`
* 默认值: `"nonebot.drivers.fastapi"`
* **默认值**: `"nonebot.drivers.fastapi"`
* 说明:
NoneBot 运行所使用的 `Driver` 。继承自 `nonebot.driver.BaseDriver`
* **说明**
NoneBot 运行所使用的 `Driver` 。继承自 `nonebot.driver.BaseDriver`
### `host`
* 类型: `IPvAnyAddress`
* **类型**: `IPvAnyAddress`
* 默认值: `127.0.0.1`
* **默认值**: `127.0.0.1`
* 说明:
NoneBot 的 HTTP 和 WebSocket 服务端监听的 IP/主机名。
* **说明**
NoneBot 的 HTTP 和 WebSocket 服务端监听的 IP/主机名。
### `port`
* 类型: `int`
* **类型**: `int`
* 默认值: `8080`
* **默认值**: `8080`
* 说明:
NoneBot 的 HTTP 和 WebSocket 服务端监听的端口。
* **说明**
NoneBot 的 HTTP 和 WebSocket 服务端监听的端口。
### `debug`
* 类型: `bool`
* **类型**: `bool`
* 默认值: `False`
* **默认值**: `False`
* 说明:
是否以调试模式运行 NoneBot。
* **说明**
是否以调试模式运行 NoneBot。
### `api_root`
* 类型: `Dict[str, str]`
* **类型**: `Dict[str, str]`
* 默认值: `{}`
* **默认值**: `{}`
* 说明:
以机器人 ID 为键,上报地址为值的字典,环境变量或文件中应使用 json 序列化。
* **说明**
以机器人 ID 为键,上报地址为值的字典,环境变量或文件中应使用 json 序列化。
* 示例:
* **示例**
```default
API_ROOT={"123456": "http://127.0.0.1:5700"}
@ -119,30 +132,35 @@ API_ROOT={"123456": "http://127.0.0.1:5700"}
### `api_timeout`
* 类型: `Optional[float]`
* **类型**: `Optional[float]`
* 默认值: `30.`
* **默认值**: `30.`
* 说明:
API 请求超时时间,单位: 秒。
* **说明**
API 请求超时时间,单位: 秒。
### `access_token`
* 类型: `Optional[str]`
* **类型**: `Optional[str]`
* 默认值: `None`
* **默认值**: `None`
* 说明:
API 请求以及上报所需密钥,在请求头中携带。
* **说明**
API 请求以及上报所需密钥,在请求头中携带。
* 示例:
* **示例**
```http
POST /cqhttp/ HTTP/1.1
@ -153,17 +171,20 @@ Authorization: Bearer kSLuTF2GC2Q4q4ugm3
### `secret`
* 类型: `Optional[str]`
* **类型**: `Optional[str]`
* 默认值: `None`
* **默认值**: `None`
* 说明:
HTTP POST 形式上报所需签名,在请求头中携带。
* **说明**
HTTP POST 形式上报所需签名,在请求头中携带。
* 示例:
* **示例**
```http
POST /cqhttp/ HTTP/1.1
@ -174,17 +195,20 @@ X-Signature: sha1=f9ddd4863ace61e64f462d41ca311e3d2c1176e2
### `superusers`
* 类型: `Set[int]`
* **类型**: `Set[int]`
* 默认值: `set()`
* **默认值**: `set()`
* 说明:
机器人超级用户。
* **说明**
机器人超级用户。
* 示例:
* **示例**
```default
SUPER_USERS=[12345789]
@ -194,56 +218,65 @@ SUPER_USERS=[12345789]
### `nickname`
* 类型: `Set[str]`
* **类型**: `Set[str]`
* 默认值: `set()`
* **默认值**: `set()`
* 说明:
机器人昵称。
* **说明**
机器人昵称。
### `command_start`
* 类型: `Set[str]`
* **类型**: `Set[str]`
* 默认值: `{"/"}`
* **默认值**: `{"/"}`
* 说明:
命令的起始标记,用于判断一条消息是不是命令。
* **说明**
命令的起始标记,用于判断一条消息是不是命令。
### `command_sep`
* 类型: `Set[str]`
* **类型**: `Set[str]`
* 默认值: `{"."}`
* **默认值**: `{"."}`
* 说明:
命令的分隔标记,用于将文本形式的命令切分为元组(实际的命令名)。
* **说明**
命令的分隔标记,用于将文本形式的命令切分为元组(实际的命令名)。
### `session_expire_timeout`
* 类型: `timedelta`
* **类型**: `timedelta`
* 默认值: `timedelta(minutes=2)`
* **默认值**: `timedelta(minutes=2)`
* 说明:
等待用户回复的超时时间。
* **说明**
等待用户回复的超时时间。
* 示例:
* **示例**
```default
SESSION_EXPIRE_TIMEOUT=120 # 单位: 秒
@ -255,11 +288,12 @@ SESSION_EXPIRE_TIMEOUT=P[DD]DT[HH]H[MM]M[SS]S # ISO 8601
### `apscheduler_config`
* 类型: `dict`
* **类型**: `dict`
* 默认值: `{"apscheduler.timezone": "Asia/Shanghai"}`
* **默认值**: `{"apscheduler.timezone": "Asia/Shanghai"}`
* 说明:
APScheduler 的配置对象,见 [Configuring the Scheduler](https://apscheduler.readthedocs.io/en/latest/userguide.html#configuring-the-scheduler)
* **说明**
APScheduler 的配置对象,见 [Configuring the Scheduler](https://apscheduler.readthedocs.io/en/latest/userguide.html#configuring-the-scheduler)

View File

@ -46,10 +46,11 @@ nonebot.export().default = "bar"
def some_function():
pass
# this don't work under python 3.9
# this doesn't work before python 3.9
# use
# export = nonebot.export(); @export.sub
# instead
# See also PEP-614: https://www.python.org/dev/peps/pep-0614/
@nonebot.export().sub
def something_else():
pass