iamai.adapter.gensokyo.message module#
GSK 适配器消息。
- class iamai.adapter.gensokyo.message.GSKMessage(*messages: List[MessageSegmentT] | MessageSegmentT | str | Mapping[str, Any])[source]#
Bases:
Message
[GSKMessageSegment]GSK 消息。
- classmethod get_segment_class() Type[GSKMessageSegment] [source]#
获取消息字段类。
- Returns:
消息字段类。
- class iamai.adapter.gensokyo.message.GSKMessageSegment(*, type: str, data: Dict[str, Any] = None)[source]#
Bases:
MessageSegment[GSKMessage]
GSK 消息字段。
- classmethod from_str(msg: str) Self [source]#
用于将 str 转换为消息字段。
- Parameters:
msg – 要解析为消息字段的数据。
- Returns:
由 str 转换的消息字段。
- classmethod get_message_class() Type[GSKMessage] [source]#
获取消息类。
- Returns:
消息类。
- classmethod image(file: str, type_: Literal['flash'] | None = None, cache: bool = True, proxy: bool = True, timeout: int | None = None) Self [source]#
图片
- classmethod location(lat: float, lon: float, title: str | None, content: str | None = None) Self [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 music_custom(url: str, audio: str, title: str, content: str | None = None, image: str | None = None) Self [source]#
音乐自定义分享
- classmethod node_custom(user_id: int, nickname: str, content: GSKMessage) Self [source]#
合并转发自定义节点
- classmethod record(file: str, magic: bool = False, cache: bool = True, proxy: bool = True, timeout: int | None = None) Self [source]#
语音
链接分享