iamai.adapter.kook.message module#
Kook 适配器消息。
- class iamai.adapter.kook.message.KookMessage(*messages: List[MessageSegmentT] | MessageSegmentT | str | Mapping[str, Any])[source]#
Bases:
Message
[KookMessageSegment]Kook v3 协议 Message 适配。
- class iamai.adapter.kook.message.KookMessageSegment(*, type: str, data: Dict[str, Any] = None)[source]#
Bases:
MessageSegment[KookMessage]
Kook 消息字段。
- classmethod Card(content: Any) KookMessageSegment [source]#
构造卡片消息
@param content: KMarkdown消息内容(语法参考:https://developer.kookapp.cn/doc/cardmessage)
- classmethod KMarkdown(content: str, raw_content: str | None = None) KookMessageSegment [source]#
构造KMarkdown消息段
@param content: KMarkdown消息内容(语法参考:https://developer.kookapp.cn/doc/kmarkdown) @param raw_content: (可选)消息段的纯文本内容
- classmethod at(user_id: str) KookMessageSegment [source]#
- classmethod audio(file_key: str, title: str | None = None, cover_file_key: str | None = None) KookMessageSegment [source]#
- classmethod file(file_key: str, title: str | None = None) KookMessageSegment [source]#
- classmethod image(file_key: str) KookMessageSegment [source]#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'data': FieldInfo(annotation=Dict[str, Any], required=False, default_factory=dict), 'type': FieldInfo(annotation=str, required=True)}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- classmethod quote(msg_id: str) KookMessageSegment [source]#
- classmethod text(text: str) KookMessageSegment [source]#
- classmethod video(file_key: str, title: str | None = None) KookMessageSegment [source]#