iamai.adapter.kook.config module#

Kook 适配器配置。

class iamai.adapter.kook.config.Config(*, adapter_type: Literal['ws', 'wb'] = 'ws', reconnect_interval: int = 3, api_timeout: int = 1000, access_token: str = '', compress: Literal[0, 1] = 0, show_raw: bool = False, report_self_message: bool = False, **extra_data: Any)[source]#

Bases: ConfigModel

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

adapter_type#

适配器类型,需要和协议端配置相同。

Type:

Literal[‘ws’, ‘wb’]

reconnect_interval#

重连等待时间。

Type:

int

api_timeout#

进行 API 调用时等待返回响应的超时时间。

Type:

int

access_token#

鉴权。

Type:

str

compress#

是否启用压缩,默认为 0,不启用。

Type:

Literal[0, 1]

show_raw#

是否显示原始数据,默认为 False,不显示。

Type:

bool

access_token: str#
adapter_type: Literal['ws', 'wb']#
api_timeout: int#
compress: Literal[0, 1]#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'allow'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'access_token': FieldInfo(annotation=str, required=False, default=''), 'adapter_type': FieldInfo(annotation=Literal['ws', 'wb'], required=False, default='ws'), 'api_timeout': FieldInfo(annotation=int, required=False, default=1000), 'compress': FieldInfo(annotation=Literal[0, 1], required=False, default=0), 'reconnect_interval': FieldInfo(annotation=int, required=False, default=3), 'report_self_message': FieldInfo(annotation=bool, required=False, default=False), 'show_raw': FieldInfo(annotation=bool, required=False, default=False)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

reconnect_interval: int#
report_self_message: bool#
show_raw: bool#