mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-16 11:00:54 +00:00
✏️ fix docstring typo
This commit is contained in:
@ -102,9 +102,9 @@ class Env(BaseSettings):
|
||||
|
||||
environment: str = "prod"
|
||||
"""
|
||||
- 类型: ``str``
|
||||
- 默认值: ``"prod"``
|
||||
- 说明:
|
||||
- **类型**: ``str``
|
||||
- **默认值**: ``"prod"``
|
||||
:说明:
|
||||
当前环境名。 NoneBot 将从 ``.env.{environment}`` 文件中加载配置。
|
||||
"""
|
||||
|
||||
@ -122,33 +122,33 @@ class Config(BaseConfig):
|
||||
# nonebot configs
|
||||
driver: str = "nonebot.drivers.fastapi"
|
||||
"""
|
||||
- 类型: ``str``
|
||||
- 默认值: ``"nonebot.drivers.fastapi"``
|
||||
- 说明:
|
||||
- **类型**: ``str``
|
||||
- **默认值**: ``"nonebot.drivers.fastapi"``
|
||||
:说明:
|
||||
|
||||
NoneBot 运行所使用的 ``Driver`` 。继承自 ``nonebot.driver.BaseDriver`` 。
|
||||
"""
|
||||
host: IPvAnyAddress = IPv4Address("127.0.0.1") # type: ignore
|
||||
"""
|
||||
- 类型: ``IPvAnyAddress``
|
||||
- 默认值: ``127.0.0.1``
|
||||
- 说明:
|
||||
- **类型**: ``IPvAnyAddress``
|
||||
- **默认值**: ``127.0.0.1``
|
||||
:说明:
|
||||
|
||||
NoneBot 的 HTTP 和 WebSocket 服务端监听的 IP/主机名。
|
||||
"""
|
||||
port: int = 8080
|
||||
"""
|
||||
- 类型: ``int``
|
||||
- 默认值: ``8080``
|
||||
- 说明:
|
||||
- **类型**: ``int``
|
||||
- **默认值**: ``8080``
|
||||
:说明:
|
||||
|
||||
NoneBot 的 HTTP 和 WebSocket 服务端监听的端口。
|
||||
"""
|
||||
debug: bool = False
|
||||
"""
|
||||
- 类型: ``bool``
|
||||
- 默认值: ``False``
|
||||
- 说明:
|
||||
- **类型**: ``bool``
|
||||
- **默认值**: ``False``
|
||||
:说明:
|
||||
|
||||
是否以调试模式运行 NoneBot。
|
||||
"""
|
||||
@ -156,13 +156,13 @@ class Config(BaseConfig):
|
||||
# bot connection configs
|
||||
api_root: Dict[str, str] = {}
|
||||
"""
|
||||
- 类型: ``Dict[str, str]``
|
||||
- 默认值: ``{}``
|
||||
- 说明:
|
||||
- **类型**: ``Dict[str, str]``
|
||||
- **默认值**: ``{}``
|
||||
:说明:
|
||||
|
||||
以机器人 ID 为键,上报地址为值的字典,环境变量或文件中应使用 json 序列化。
|
||||
|
||||
- 示例:
|
||||
:示例:
|
||||
|
||||
.. code-block:: default
|
||||
|
||||
@ -170,21 +170,21 @@ class Config(BaseConfig):
|
||||
"""
|
||||
api_timeout: Optional[float] = 30.
|
||||
"""
|
||||
- 类型: ``Optional[float]``
|
||||
- 默认值: ``30.``
|
||||
- 说明:
|
||||
- **类型**: ``Optional[float]``
|
||||
- **默认值**: ``30.``
|
||||
:说明:
|
||||
|
||||
API 请求超时时间,单位: 秒。
|
||||
"""
|
||||
access_token: Optional[str] = None
|
||||
"""
|
||||
- 类型: ``Optional[str]``
|
||||
- 默认值: ``None``
|
||||
- 说明:
|
||||
- **类型**: ``Optional[str]``
|
||||
- **默认值**: ``None``
|
||||
:说明:
|
||||
|
||||
API 请求以及上报所需密钥,在请求头中携带。
|
||||
|
||||
- 示例:
|
||||
:示例:
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
@ -193,13 +193,13 @@ class Config(BaseConfig):
|
||||
"""
|
||||
secret: Optional[str] = None
|
||||
"""
|
||||
- 类型: ``Optional[str]``
|
||||
- 默认值: ``None``
|
||||
- 说明:
|
||||
- **类型**: ``Optional[str]``
|
||||
- **默认值**: ``None``
|
||||
:说明:
|
||||
|
||||
HTTP POST 形式上报所需签名,在请求头中携带。
|
||||
|
||||
- 示例:
|
||||
:示例:
|
||||
|
||||
.. code-block:: http
|
||||
|
||||
@ -210,13 +210,13 @@ class Config(BaseConfig):
|
||||
# bot runtime configs
|
||||
superusers: Set[int] = set()
|
||||
"""
|
||||
- 类型: ``Set[int]``
|
||||
- 默认值: ``set()``
|
||||
- 说明:
|
||||
- **类型**: ``Set[int]``
|
||||
- **默认值**: ``set()``
|
||||
:说明:
|
||||
|
||||
机器人超级用户。
|
||||
|
||||
- 示例:
|
||||
:示例:
|
||||
|
||||
.. code-block:: default
|
||||
|
||||
@ -224,37 +224,37 @@ class Config(BaseConfig):
|
||||
"""
|
||||
nickname: Set[str] = set()
|
||||
"""
|
||||
- 类型: ``Set[str]``
|
||||
- 默认值: ``set()``
|
||||
- 说明:
|
||||
- **类型**: ``Set[str]``
|
||||
- **默认值**: ``set()``
|
||||
:说明:
|
||||
|
||||
机器人昵称。
|
||||
"""
|
||||
command_start: Set[str] = {"/"}
|
||||
"""
|
||||
- 类型: ``Set[str]``
|
||||
- 默认值: ``{"/"}``
|
||||
- 说明:
|
||||
- **类型**: ``Set[str]``
|
||||
- **默认值**: ``{"/"}``
|
||||
:说明:
|
||||
|
||||
命令的起始标记,用于判断一条消息是不是命令。
|
||||
"""
|
||||
command_sep: Set[str] = {"."}
|
||||
"""
|
||||
- 类型: ``Set[str]``
|
||||
- 默认值: ``{"."}``
|
||||
- 说明:
|
||||
- **类型**: ``Set[str]``
|
||||
- **默认值**: ``{"."}``
|
||||
:说明:
|
||||
|
||||
命令的分隔标记,用于将文本形式的命令切分为元组(实际的命令名)。
|
||||
"""
|
||||
session_expire_timeout: timedelta = timedelta(minutes=2)
|
||||
"""
|
||||
- 类型: ``timedelta``
|
||||
- 默认值: ``timedelta(minutes=2)``
|
||||
- 说明:
|
||||
- **类型**: ``timedelta``
|
||||
- **默认值**: ``timedelta(minutes=2)``
|
||||
:说明:
|
||||
|
||||
等待用户回复的超时时间。
|
||||
|
||||
- 示例:
|
||||
:示例:
|
||||
|
||||
.. code-block:: default
|
||||
|
||||
@ -264,9 +264,9 @@ class Config(BaseConfig):
|
||||
"""
|
||||
apscheduler_config: dict = {"apscheduler.timezone": "Asia/Shanghai"}
|
||||
"""
|
||||
- 类型: ``dict``
|
||||
- 默认值: ``{"apscheduler.timezone": "Asia/Shanghai"}``
|
||||
- 说明:
|
||||
- **类型**: ``dict``
|
||||
- **默认值**: ``{"apscheduler.timezone": "Asia/Shanghai"}``
|
||||
:说明:
|
||||
|
||||
APScheduler 的配置对象,见 `Configuring the Scheduler`_
|
||||
|
||||
|
Reference in New Issue
Block a user