Skip to content
On this page

alicebot.adapter.onebot.config

OneBot 适配器配置。

class Config

Bases: alicebot.config.ConfigModel

OneBot 配置类,将在适配器被加载时被混入到机器人主配置中。

  • Attributes

    • adapter_type (Literal['ws', 'reverse-ws', 'ws-reverse']) - 适配器类型,需要和协议端配置相同。

    • host (str) - 本机域名。

    • port (int) - 监听的端口。

    • url (str) - WebSocket 路径,需和协议端配置相同。

    • reconnect_interval (int) - 重连等待时间。

    • api_timeout (int) - 进行 API 调用时等待返回响应的超时时间。

    • access_token (str) - 鉴权。

method __init__(__pydantic_self__, **data) {#BaseModel.__init__}

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

  • Arguments

    • data (Any)
  • Returns

    Type: None

Released under the MIT License.