iamai.adapter.kook.event module#

Kook 适配器事件。

class iamai.adapter.kook.event.Attachment(*, type: str, name: str, url: Url, file_type: str | None = None, size: int | None = None, duration: float | None = None, width: int | None = None, hight: int | None = None)[source]#

Bases: BaseModel

duration: float | None#
file_type: str | None#
hight: int | None#
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]] = {'duration': FieldInfo(annotation=Union[float, NoneType], required=False), 'file_type': FieldInfo(annotation=Union[str, NoneType], required=False), 'hight': FieldInfo(annotation=Union[int, NoneType], required=False), 'name': FieldInfo(annotation=str, required=True), 'size': FieldInfo(annotation=Union[int, NoneType], required=False), 'type': FieldInfo(annotation=str, required=True), 'url': FieldInfo(annotation=Url, required=True, metadata=[UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)]), 'width': FieldInfo(annotation=Union[int, NoneType], required=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.

name: str#
size: int | None#
type: str#
url: Url#
width: int | None#
class iamai.adapter.kook.event.Attachments(*, type: str | None = None, url: str | None = None, name: str | None = None, size: int | None = None)[source]#

Bases: BaseModel

附加的多媒体数据

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]] = {'name': FieldInfo(annotation=Union[str, NoneType], required=False), 'size': FieldInfo(annotation=Union[int, NoneType], required=False), 'type': FieldInfo(annotation=Union[str, NoneType], required=False), 'url': FieldInfo(annotation=Union[str, NoneType], required=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.

name: str | None#

多媒体名

size: int | None#

大小 单位(B)

type: str | None#

多媒体类型

url: str | None#

多媒体地址

class iamai.adapter.kook.event.AttrDict(data=None)[source]#

Bases: UserDict

class iamai.adapter.kook.event.BaseMessage(*, id: str | None = None, type: int | None = None, content: str | None = None, embeds: List[dict] | None = None, attachments: bool | Attachments | None = None, create_at: int | None = None, updated_at: int | None = None, reactions: List[Reaction] | None = None, image_name: str | None = None, read_status: bool | None = None, quote: Quote | None = None, mention_info: MentionInfo | None = None)[source]#

Bases: BaseModel

attachments: bool | Attachments | None#

附加的多媒体数据

content: str | None#

消息内容

create_at: int | None#

创建时间

embeds: List[dict] | None#

超链接解析数据

id_: str | None#

消息 ID

image_name: str | None#
mention_info: MentionInfo | None#

引用特定用户或特定角色的信息

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]] = {'attachments': FieldInfo(annotation=Union[bool, Attachments, NoneType], required=False), 'content': FieldInfo(annotation=Union[str, NoneType], required=False), 'create_at': FieldInfo(annotation=Union[int, NoneType], required=False), 'embeds': FieldInfo(annotation=Union[List[dict], NoneType], required=False), 'id_': FieldInfo(annotation=Union[str, NoneType], required=False, alias='id', alias_priority=2), 'image_name': FieldInfo(annotation=Union[str, NoneType], required=False), 'mention_info': FieldInfo(annotation=Union[MentionInfo, NoneType], required=False), 'quote': FieldInfo(annotation=Union[Quote, NoneType], required=False), 'reactions': FieldInfo(annotation=Union[List[Reaction], NoneType], required=False), 'read_status': FieldInfo(annotation=Union[bool, NoneType], required=False), 'type': FieldInfo(annotation=Union[int, NoneType], required=False), 'updated_at': FieldInfo(annotation=Union[int, NoneType], required=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.

quote: Quote | None#

引用数据

reactions: List[Reaction] | None#

回应数据

read_status: bool | None#

是否已读

type: int | None#

消息类型

updated_at: int | None#

更新时间

class iamai.adapter.kook.event.BlackList(*, user_id: str | None = None, created_time: int | None = None, remark: str | None = None, user: User | None = None)[source]#

Bases: BaseModel

黑名单

created_time: int | None#

加入黑名单的时间戳(毫秒)

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]] = {'created_time': FieldInfo(annotation=Union[int, NoneType], required=False), 'remark': FieldInfo(annotation=Union[str, NoneType], required=False), 'user': FieldInfo(annotation=Union[User, NoneType], required=False), 'user_id': FieldInfo(annotation=Union[str, NoneType], required=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.

remark: str | None#

加入黑名单的原因

user: User | None#

用户

user_id: str | None#

用户 id

class iamai.adapter.kook.event.BlackListsReturn(*, meta: Meta | None = None, sort: Dict[str, Any] | None = None, items: List[BlackList] | None = None)[source]#

Bases: ListReturn

获取黑名单列表返回信息

blacklists: List[BlackList] | None#

黑名单列表

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]] = {'blacklists': FieldInfo(annotation=Union[List[BlackList], NoneType], required=False, alias='items', alias_priority=2), 'meta': FieldInfo(annotation=Union[Meta, NoneType], required=False), 'sort': FieldInfo(annotation=Union[Dict[str, Any], NoneType], required=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.

class iamai.adapter.kook.event.CartBtnClickNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['message_btn_click'], group_id: int, **extra_data: Any)[source]#

Bases: NoticeEvent

Card 消息中的 Button 点击事件

group_id: int#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['message_btn_click'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['message_btn_click']#
user_id: str#
class iamai.adapter.kook.event.ChannelAddReactionEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['added_reaction'], group_id: int, **extra_data: Any)[source]#

Bases: ChannelNoticeEvent

频道内用户添加 reaction

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['added_reaction'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['added_reaction']#
class iamai.adapter.kook.event.ChannelAddedEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['added_channel'], group_id: int, **extra_data: Any)[source]#

Bases: ChannelNoticeEvent

新增频道

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['added_channel'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['added_channel']#
class iamai.adapter.kook.event.ChannelDeleteEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['deleted_channel'], group_id: int, **extra_data: Any)[source]#

Bases: ChannelNoticeEvent

删除频道

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['deleted_channel'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['deleted_channel']#
class iamai.adapter.kook.event.ChannelDeleteMessageEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['deleted_message'], group_id: int, **extra_data: Any)[source]#

Bases: ChannelNoticeEvent

频道消息被删除

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['deleted_message'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['deleted_message']#
class iamai.adapter.kook.event.ChannelDeletedReactionEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['deleted_reaction'], group_id: int, **extra_data: Any)[source]#

Bases: ChannelNoticeEvent

频道内用户删除 reaction

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['deleted_reaction'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['deleted_reaction']#
class iamai.adapter.kook.event.ChannelMessage(*, id: str | None = None, type: int | None = None, content: str | None = None, embeds: List[dict] | None = None, attachments: bool | Attachments | None = None, create_at: int | None = None, updated_at: int | None = None, reactions: List[Reaction] | None = None, image_name: str | None = None, read_status: bool | None = None, quote: Quote | None = None, mention_info: MentionInfo | None = None, author: User | None = None, mention: List[Any] | None = None, mention_all: bool | None = None, mention_roles: List[Any] | None = None, mention_here: bool | None = None)[source]#

Bases: BaseMessage

频道消息

author: User | None#
mention: List[Any] | None#
mention_all: bool | None#
mention_here: bool | None#
mention_roles: List[Any] | None#
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]] = {'attachments': FieldInfo(annotation=Union[bool, Attachments, NoneType], required=False), 'author': FieldInfo(annotation=Union[User, NoneType], required=False), 'content': FieldInfo(annotation=Union[str, NoneType], required=False), 'create_at': FieldInfo(annotation=Union[int, NoneType], required=False), 'embeds': FieldInfo(annotation=Union[List[dict], NoneType], required=False), 'id_': FieldInfo(annotation=Union[str, NoneType], required=False, alias='id', alias_priority=2), 'image_name': FieldInfo(annotation=Union[str, NoneType], required=False), 'mention': FieldInfo(annotation=Union[List[Any], NoneType], required=False), 'mention_all': FieldInfo(annotation=Union[bool, NoneType], required=False), 'mention_here': FieldInfo(annotation=Union[bool, NoneType], required=False), 'mention_info': FieldInfo(annotation=Union[MentionInfo, NoneType], required=False), 'mention_roles': FieldInfo(annotation=Union[List[Any], NoneType], required=False), 'quote': FieldInfo(annotation=Union[Quote, NoneType], required=False), 'reactions': FieldInfo(annotation=Union[List[Reaction], NoneType], required=False), 'read_status': FieldInfo(annotation=Union[bool, NoneType], required=False), 'type': FieldInfo(annotation=Union[int, NoneType], required=False), 'updated_at': FieldInfo(annotation=Union[int, NoneType], required=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.

class iamai.adapter.kook.event.ChannelMessageEvent(*, adapter: Any, type: str | None, post_type: Literal['message'] = 'message', channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, message_type: Literal['group'], sub_type: str, event: EventMessage, group_id: str, **extra_data: Any)[source]#

Bases: MessageEvent

公共频道消息

group_id: str#
message_type: Literal['group']#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'event': FieldInfo(annotation=EventMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=str, required=True), 'message_type': FieldInfo(annotation=Literal['group'], required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'post_type': FieldInfo(annotation=Literal['message'], required=False, default='message'), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'sub_type': FieldInfo(annotation=str, required=True), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

async reply(msg: T_KookMSG) Dict[str, Any][source]#

回复消息。

Parameters:

msg – 回复消息的内容,同 call_api() 方法。

Returns:

API 请求响应。

class iamai.adapter.kook.event.ChannelMessagesReturn(*, items: List[ChannelMessage] | None = None)[source]#

Bases: BaseModel

获取私信聊天消息列表返回信息

direct_messages: List[ChannelMessage] | None#
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]] = {'direct_messages': FieldInfo(annotation=Union[List[ChannelMessage], NoneType], required=False, alias='items', alias_priority=2)}#

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

This replaces Model.__fields__ from Pydantic V1.

class iamai.adapter.kook.event.ChannelNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: str, group_id: int, **extra_data: Any)[source]#

Bases: NoticeEvent

频道消息事件

group_id: int#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=str, required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

class iamai.adapter.kook.event.ChannelPinnedMessageEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['pinned_message'], group_id: int, **extra_data: Any)[source]#

Bases: ChannelNoticeEvent

新增频道置顶消息

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['pinned_message'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['pinned_message']#
class iamai.adapter.kook.event.ChannelRoleInfo(*, permission_overwrites: List[PermissionOverwrite] | None = None, permission_users: List[PermissionUser] | None = None, permission_sync: int | None = None)[source]#

Bases: BaseModel

频道角色权限详情

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]] = {'permission_overwrites': FieldInfo(annotation=Union[List[PermissionOverwrite], NoneType], required=False), 'permission_sync': FieldInfo(annotation=Union[int, NoneType], required=False), 'permission_users': FieldInfo(annotation=Union[List[PermissionUser], NoneType], required=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.

permission_overwrites: List[PermissionOverwrite] | None#

针对角色在该频道的权限覆写规则组成的列表

permission_sync: int | None#

权限设置是否与分组同步, 1 or 0

permission_users: List[PermissionUser] | None#

针对用户在该频道的权限覆写规则组成的列表

class iamai.adapter.kook.event.ChannelRoleReturn(*, role_id: int | None = None, user_id: str | None = None, allow: int | None = None, deny: int | None = None)[source]#

Bases: BaseModel

创建或更新频道角色权限返回信息

allow: int | None#
deny: int | None#
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]] = {'allow': FieldInfo(annotation=Union[int, NoneType], required=False), 'deny': FieldInfo(annotation=Union[int, NoneType], required=False), 'role_id': FieldInfo(annotation=Union[int, NoneType], required=False), 'user_id': FieldInfo(annotation=Union[str, NoneType], required=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.

role_id: int | None#
user_id: str | None#
class iamai.adapter.kook.event.ChannelUnpinnedMessageEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['unpinned_message'], group_id: int, **extra_data: Any)[source]#

Bases: ChannelNoticeEvent

取消频道置顶消息

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['unpinned_message'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['unpinned_message']#
class iamai.adapter.kook.event.ChannelUpdatedEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['updated_channel'], group_id: int, **extra_data: Any)[source]#

Bases: ChannelNoticeEvent

修改频道信息

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['updated_channel'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['updated_channel']#
class iamai.adapter.kook.event.ChannelUpdatedMessageEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['updated_message'], group_id: int, **extra_data: Any)[source]#

Bases: ChannelNoticeEvent

频道消息更新

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['updated_message'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['updated_message']#
class iamai.adapter.kook.event.ChannelsReturn(*, meta: Meta | None = None, sort: Dict[str, Any] | None = None, items: List[Channel] | None = None)[source]#

Bases: ListReturn

channels: List[Channel] | None#
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]] = {'channels': FieldInfo(annotation=Union[List[Channel], NoneType], required=False, alias='items', alias_priority=2), 'meta': FieldInfo(annotation=Union[Meta, NoneType], required=False), 'sort': FieldInfo(annotation=Union[Dict[str, Any], NoneType], required=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.

class iamai.adapter.kook.event.DirectMessage(*, id: str | None = None, type: int | None = None, content: str | None = None, embeds: List[dict] | None = None, attachments: bool | Attachments | None = None, create_at: int | None = None, updated_at: int | None = None, reactions: List[Reaction] | None = None, image_name: str | None = None, read_status: bool | None = None, quote: Quote | None = None, mention_info: MentionInfo | None = None, author_id: str | None = None, from_type: int | None = None, msg_icon: str | None = None)[source]#

Bases: BaseMessage

私聊消息

author_id: str | None#

作者的用户 ID

from_type: int | None#

from_type

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]] = {'attachments': FieldInfo(annotation=Union[bool, Attachments, NoneType], required=False), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'content': FieldInfo(annotation=Union[str, NoneType], required=False), 'create_at': FieldInfo(annotation=Union[int, NoneType], required=False), 'embeds': FieldInfo(annotation=Union[List[dict], NoneType], required=False), 'from_type': FieldInfo(annotation=Union[int, NoneType], required=False), 'id_': FieldInfo(annotation=Union[str, NoneType], required=False, alias='id', alias_priority=2), 'image_name': FieldInfo(annotation=Union[str, NoneType], required=False), 'mention_info': FieldInfo(annotation=Union[MentionInfo, NoneType], required=False), 'msg_icon': FieldInfo(annotation=Union[str, NoneType], required=False), 'quote': FieldInfo(annotation=Union[Quote, NoneType], required=False), 'reactions': FieldInfo(annotation=Union[List[Reaction], NoneType], required=False), 'read_status': FieldInfo(annotation=Union[bool, NoneType], required=False), 'type': FieldInfo(annotation=Union[int, NoneType], required=False), 'updated_at': FieldInfo(annotation=Union[int, NoneType], required=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.

msg_icon: str | None#

msg_icon

class iamai.adapter.kook.event.DirectMessagesReturn(*, items: List[DirectMessage] | None = None)[source]#

Bases: BaseModel

获取私信聊天消息列表返回信息

direct_messages: List[DirectMessage] | None#
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]] = {'direct_messages': FieldInfo(annotation=Union[List[DirectMessage], NoneType], required=False, alias='items', alias_priority=2)}#

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

This replaces Model.__fields__ from Pydantic V1.

class iamai.adapter.kook.event.EventMessage(*, type: int | str, guild_id: str | None, channel_name: str | None, mention: List | None, mention_all: bool | None, mention_roles: List | None, mention_here: bool | None, nav_channels: List | None, author: User, kmarkdown: Kmarkdown | None, code: str | None = None, attachments: Attachment | None = None, content: KookMessage)[source]#

Bases: BaseModel

attachments: Attachment | None#
author: User#
channel_name: str | None#
code: str | None#
content: KookMessage#
guild_id: str | None#
kmarkdown: Kmarkdown | None#
mention: List | None#
mention_all: bool | None#
mention_here: bool | None#
mention_roles: List | None#
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]] = {'attachments': FieldInfo(annotation=Union[Attachment, NoneType], required=False), 'author': FieldInfo(annotation=User, required=True), 'channel_name': FieldInfo(annotation=Union[str, NoneType], required=True), 'code': FieldInfo(annotation=Union[str, NoneType], required=False), 'content': FieldInfo(annotation=KookMessage, required=True), 'guild_id': FieldInfo(annotation=Union[str, NoneType], required=True), 'kmarkdown': FieldInfo(annotation=Union[Kmarkdown, NoneType], required=True), 'mention': FieldInfo(annotation=Union[List, NoneType], required=True), 'mention_all': FieldInfo(annotation=Union[bool, NoneType], required=True), 'mention_here': FieldInfo(annotation=Union[bool, NoneType], required=True), 'mention_roles': FieldInfo(annotation=Union[List, NoneType], required=True), 'nav_channels': FieldInfo(annotation=Union[List, NoneType], required=True), 'type': FieldInfo(annotation=Union[int, 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.

nav_channels: List | None#
type: int | str#
class iamai.adapter.kook.event.EventTypes(value)[source]#

Bases: IntEnum

事件主要格式 Kook 协议事件,字段与 Kook 一致。各事件字段参考 Kook 文档

audio = 8#
card = 10#
file = 4#
image = 2#
kmarkdown = 9#
sys = 255#
text = 1#
video = 3#
class iamai.adapter.kook.event.Extra(*, type: int | str = None, guild_id: str | None = None, channel_name: str | None = None, mention: List[str] | None = None, mention_all: bool | None = None, mention_roles: List[str] | None = None, mention_here: bool | None = None, author: User | None = None, body: AttrDict | None = None, attachments: Attachment | None = None, code: str | None = None)[source]#

Bases: BaseModel

class Config[source]#

Bases: object

arbitrary_types_allowed = True#
attachments: Attachment | None#
author: User | None#
body: AttrDict | None#
channel_name: str | None#
code: str | None#
classmethod convert_body(v)[source]#
guild_id: str | None#
mention: List[str] | None#
mention_all: bool | None#
mention_here: bool | None#
mention_roles: List[str] | None#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

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

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}#

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'attachments': FieldInfo(annotation=Union[Attachment, NoneType], required=False), 'author': FieldInfo(annotation=Union[User, NoneType], required=False), 'body': FieldInfo(annotation=Union[AttrDict, NoneType], required=False), 'channel_name': FieldInfo(annotation=Union[str, NoneType], required=False), 'code': FieldInfo(annotation=Union[str, NoneType], required=False), 'guild_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'mention': FieldInfo(annotation=Union[List[str], NoneType], required=False), 'mention_all': FieldInfo(annotation=Union[bool, NoneType], required=False), 'mention_here': FieldInfo(annotation=Union[bool, NoneType], required=False), 'mention_roles': FieldInfo(annotation=Union[List[str], NoneType], required=False), 'type_': FieldInfo(annotation=Union[int, str], required=False, alias='type', alias_priority=2)}#

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

This replaces Model.__fields__ from Pydantic V1.

type_: int | str#
class iamai.adapter.kook.event.GuilRoleReturn(*, user_id: str | None = None, guild_id: str | None = None, roles: List[int] | None = None)[source]#

Bases: BaseModel

赋予或删除用户角色返回信息

guild_id: str | None#

服务器 id

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]] = {'guild_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'roles': FieldInfo(annotation=Union[List[int], NoneType], required=False), 'user_id': FieldInfo(annotation=Union[str, NoneType], required=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.

roles: List[int] | None#

角色 id 的列表

user_id: str | None#

用户 id

class iamai.adapter.kook.event.GuildAddBlockListNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['added_block_list'], group_id: int, **extra_data: Any)[source]#

Bases: GuildNoticeEvent

服务器封禁用户

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['added_block_list'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['added_block_list']#
class iamai.adapter.kook.event.GuildDeleteBlockListNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['deleted_block_list'], group_id: int, **extra_data: Any)[source]#

Bases: GuildNoticeEvent

服务器取消封禁用户

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['deleted_block_list'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['deleted_block_list']#
class iamai.adapter.kook.event.GuildDeleteNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['deleted_guild'], group_id: int, **extra_data: Any)[source]#

Bases: GuildNoticeEvent

服务器删除

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['deleted_guild'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['deleted_guild']#
class iamai.adapter.kook.event.GuildEmoji(*, name: str | None = None, id: str | None = None, user_info: User | None = None)[source]#

Bases: BaseModel

服务器表情

id_: str | None#

表情的 ID

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]] = {'id_': FieldInfo(annotation=Union[str, NoneType], required=False, alias='id', alias_priority=2), 'name': FieldInfo(annotation=Union[str, NoneType], required=False), 'user_info': FieldInfo(annotation=Union[User, NoneType], required=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.

name: str | None#

表情的名称

user_info: User | None#

上传用户

class iamai.adapter.kook.event.GuildEmojisReturn(*, meta: Meta | None = None, sort: Dict[str, Any] | None = None, items: List[GuildEmoji] | None = None)[source]#

Bases: ListReturn

获取服务器表情列表返回信息

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]] = {'meta': FieldInfo(annotation=Union[Meta, NoneType], required=False), 'roles': FieldInfo(annotation=Union[List[GuildEmoji], NoneType], required=False, alias='items', alias_priority=2), 'sort': FieldInfo(annotation=Union[Dict[str, Any], NoneType], required=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.

roles: List[GuildEmoji] | None#

服务器表情列表

class iamai.adapter.kook.event.GuildMemberDecreaseNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['exited_guild'], group_id: int, **extra_data: Any)[source]#

Bases: GuildMemberNoticeEvent

服务器成员退出

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['exited_guild'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['exited_guild']#
class iamai.adapter.kook.event.GuildMemberIncreaseNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['joined_guild'], group_id: int, **extra_data: Any)[source]#

Bases: GuildMemberNoticeEvent

新成员加入服务器

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['joined_guild'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['joined_guild']#
class iamai.adapter.kook.event.GuildMemberNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: str, group_id: int, **extra_data: Any)[source]#

Bases: GuildNoticeEvent

服务器成员相关事件

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=str, required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

class iamai.adapter.kook.event.GuildMemberOfflineNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['guild_member_offline'], group_id: int, **extra_data: Any)[source]#

Bases: GuildMemberNoticeEvent

服务器成员下线

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['guild_member_offline'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['guild_member_offline']#
class iamai.adapter.kook.event.GuildMemberOnlineNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['guild_member_online'], group_id: int, **extra_data: Any)[source]#

Bases: GuildMemberNoticeEvent

服务器成员上线

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['guild_member_online'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['guild_member_online']#
class iamai.adapter.kook.event.GuildMemberUpdateNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['updated_guild_member'], group_id: int, **extra_data: Any)[source]#

Bases: GuildMemberNoticeEvent

服务器成员信息更新(修改昵称)

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['updated_guild_member'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['updated_guild_member']#
class iamai.adapter.kook.event.GuildNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: str, group_id: int, **extra_data: Any)[source]#

Bases: NoticeEvent

服务器相关事件

get_guild_id()[source]#
group_id: int#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=str, required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

class iamai.adapter.kook.event.GuildRoleAddNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['added_role'], group_id: int, **extra_data: Any)[source]#

Bases: GuildRoleNoticeEvent

服务器角色增加

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['added_role'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['added_role']#
class iamai.adapter.kook.event.GuildRoleDeleteNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['deleted_role'], group_id: int, **extra_data: Any)[source]#

Bases: GuildRoleNoticeEvent

服务器角色增加

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['deleted_role'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['deleted_role']#
class iamai.adapter.kook.event.GuildRoleNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: str, group_id: int, **extra_data: Any)[source]#

Bases: GuildNoticeEvent

服务器角色相关事件

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=str, required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

class iamai.adapter.kook.event.GuildRoleUpdateNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['updated_role'], group_id: int, **extra_data: Any)[source]#

Bases: GuildRoleNoticeEvent

服务器角色增加

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['updated_role'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['updated_role']#
class iamai.adapter.kook.event.GuildUpdateNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['updated_guild'], group_id: int, **extra_data: Any)[source]#

Bases: GuildNoticeEvent

服务器信息更新

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['updated_guild'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['updated_guild']#
class iamai.adapter.kook.event.GuildUsersRetrun(*, meta: Meta | None = None, sort: Dict[str, Any] | None = None, items: List[User] | None = None, user_count: int | None = None, online_count: int | None = None, offline_count: int | None = None)[source]#

Bases: ListReturn

服务器中的用户列表

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]] = {'meta': FieldInfo(annotation=Union[Meta, NoneType], required=False), 'offline_count': FieldInfo(annotation=Union[int, NoneType], required=False), 'online_count': FieldInfo(annotation=Union[int, NoneType], required=False), 'sort': FieldInfo(annotation=Union[Dict[str, Any], NoneType], required=False), 'user_count': FieldInfo(annotation=Union[int, NoneType], required=False), 'users': FieldInfo(annotation=Union[List[User], NoneType], required=False, alias='items', alias_priority=2)}#

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

This replaces Model.__fields__ from Pydantic V1.

offline_count: int | None#

离线用户数量

online_count: int | None#

在线用户数量

user_count: int | None#

用户数量

users: List[User] | None#

用户列表

class iamai.adapter.kook.event.GuildsReturn(*, meta: Meta | None = None, sort: Dict[str, Any] | None = None, items: List[Guild] | None = None)[source]#

Bases: ListReturn

guilds: List[Guild] | None#
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]] = {'guilds': FieldInfo(annotation=Union[List[Guild], NoneType], required=False, alias='items', alias_priority=2), 'meta': FieldInfo(annotation=Union[Meta, NoneType], required=False), 'sort': FieldInfo(annotation=Union[Dict[str, Any], NoneType], required=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.

class iamai.adapter.kook.event.HeartbeatMetaEvent(*, adapter: Any, type: str | None, post_type: Literal['meta_event'], meta_event_type: Literal['heartbeat'], sub_type: str, **extra_data: Any)[source]#

Bases: MetaEvent

心跳元事件

meta_event_type: Literal['heartbeat']#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'meta_event_type': FieldInfo(annotation=Literal['heartbeat'], required=True), 'post_type': FieldInfo(annotation=Literal['meta_event'], required=True), 'sub_type': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], 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.

sub_type: str#
class iamai.adapter.kook.event.IntimacyImg(*, id: str | None = None, url: str | None = None)[source]#

Bases: BaseModel

形象图片的总列表

id_: str | None#

形象图片的 id

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]] = {'id_': FieldInfo(annotation=Union[str, NoneType], required=False, alias='id', alias_priority=2), 'url': FieldInfo(annotation=Union[str, NoneType], required=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.

url: str | None#

形象图片的地址

class iamai.adapter.kook.event.IntimacyIndexReturn(*, img_url: str | None = None, social_info: str | None = None, last_read: int | None = None, score: int | None = None, img_list: List[IntimacyImg] | None = None)[source]#

Bases: BaseModel

获取用户亲密度返回信息

img_list: List[IntimacyImg] | None#

形象图片的总列表

img_url: str | None#

机器人给用户显示的形象图片地址

last_read: int | None#

用户上次查看的时间戳

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]] = {'img_list': FieldInfo(annotation=Union[List[IntimacyImg], NoneType], required=False), 'img_url': FieldInfo(annotation=Union[str, NoneType], required=False), 'last_read': FieldInfo(annotation=Union[int, NoneType], required=False), 'score': FieldInfo(annotation=Union[int, NoneType], required=False), 'social_info': FieldInfo(annotation=Union[str, NoneType], required=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.

score: int | None#

亲密度,0-2200

social_info: str | None#

机器人显示给用户的社交信息

class iamai.adapter.kook.event.Invite(*, guild_id: str | None = None, channel_id: str | None = None, url_code: str | None = None, url: str | None = None, user: User | None = None)[source]#

Bases: BaseModel

邀请信息

channel_id: str | None#

频道 id

guild_id: str | None#

服务器 id

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]] = {'channel_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'guild_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'url': FieldInfo(annotation=Union[str, NoneType], required=False), 'url_code': FieldInfo(annotation=Union[str, NoneType], required=False), 'user': FieldInfo(annotation=Union[User, NoneType], required=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.

url: str | None#

地址

url_code: str | None#

url code

user: User | None#

用户

class iamai.adapter.kook.event.InvitesReturn(*, meta: Meta | None = None, sort: Dict[str, Any] | None = None, items: List[Invite] | None = None)[source]#

Bases: ListReturn

获取邀请列表返回信息

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]] = {'meta': FieldInfo(annotation=Union[Meta, NoneType], required=False), 'roles': FieldInfo(annotation=Union[List[Invite], NoneType], required=False, alias='items', alias_priority=2), 'sort': FieldInfo(annotation=Union[Dict[str, Any], NoneType], required=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.

roles: List[Invite] | None#

邀请列表

class iamai.adapter.kook.event.Kmarkdown(*, raw_content: str, mention_part: list, mention_role_part: list)[source]#

Bases: BaseModel

mention_part: list#
mention_role_part: list#
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]] = {'mention_part': FieldInfo(annotation=list, required=True), 'mention_role_part': FieldInfo(annotation=list, required=True), 'raw_content': 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.

raw_content: str#
class iamai.adapter.kook.event.KookEvent(*, adapter: Any, type: str | None, post_type: str, channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, **extra_data: Any)[source]#

Bases: OriginEvent

事件主要格式,来自 d 字段 Kook 协议事件,字段与 Kook 一致。各事件字段参考 Kook 文档

author_id: str | None#
channel_type: Literal['PERSON', 'GROUP']#
content: KookMessage#
extra: Extra#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'post_type': FieldInfo(annotation=str, required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

msg_id: str#
msg_timestamp: int#
nonce: str#
post_type: str#
self_id: str | None#
target_id: str#

发送目的

频道消息类时, 代表的是频道 channel_id

如果 channel_type 为 GROUP 组播且 type 为 255 系统消息时,则代表服务器 guild_id

type_: int#

文字消息 2:图片消息 3:视频消息 4:文件消息 8:音频消息 9:KMarkdown 10:card消息 255:系统消息 其它的暂未开放

Type:

1

user_id: str#
class iamai.adapter.kook.event.LifecycleMetaEvent(*, adapter: Any, type: str | None, post_type: Literal['meta_event'], meta_event_type: Literal['lifecycle'], sub_type: str, **extra_data: Any)[source]#

Bases: MetaEvent

生命周期元事件

meta_event_type: Literal['lifecycle']#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'meta_event_type': FieldInfo(annotation=Literal['lifecycle'], required=True), 'post_type': FieldInfo(annotation=Literal['meta_event'], required=True), 'sub_type': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], 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.

sub_type: str#
class iamai.adapter.kook.event.ListReturn(*, meta: Meta | None = None, sort: Dict[str, Any] | None = None)[source]#

Bases: BaseModel

meta: Meta | None#
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]] = {'meta': FieldInfo(annotation=Union[Meta, NoneType], required=False), 'sort': FieldInfo(annotation=Union[Dict[str, Any], NoneType], required=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.

sort: Dict[str, Any] | None#
class iamai.adapter.kook.event.MentionInfo(*, mention_part: List[dict] | None = None, mention_role_part: List[dict] | None = None, channel_part: List[dict] | None = None, item_part: List[dict] | None = None)[source]#

Bases: BaseModel

channel_part: List[dict] | None#
item_part: List[dict] | None#
mention_part: List[dict] | None#
mention_role_part: List[dict] | None#
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]] = {'channel_part': FieldInfo(annotation=Union[List[dict], NoneType], required=False), 'item_part': FieldInfo(annotation=Union[List[dict], NoneType], required=False), 'mention_part': FieldInfo(annotation=Union[List[dict], NoneType], required=False), 'mention_role_part': FieldInfo(annotation=Union[List[dict], NoneType], required=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.

class iamai.adapter.kook.event.MessageCreateReturn(*, msg_id: str | None = None, msg_timestamp: int | None = None, nonce: str | None = None)[source]#

Bases: BaseModel

发送频道消息返回信息

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]] = {'msg_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'msg_timestamp': FieldInfo(annotation=Union[int, NoneType], required=False), 'nonce': FieldInfo(annotation=Union[str, NoneType], required=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.

msg_id: str | None#

服务端生成的消息 id

msg_timestamp: int | None#

消息发送时间(服务器时间戳)

nonce: str | None#

随机字符串

class iamai.adapter.kook.event.MessageEvent(*, adapter: Any, type: str | None, post_type: Literal['message'] = 'message', channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, message_type: str, sub_type: str, event: EventMessage, **extra_data: Any)[source]#

Bases: KookEvent

消息事件

event: EventMessage#
get_plain_text() str[source]#

获取消息的纯文本内容。

Returns:

消息的纯文本内容。

message_type: str#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'event': FieldInfo(annotation=EventMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'message_type': FieldInfo(annotation=str, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'post_type': FieldInfo(annotation=Literal['message'], required=False, default='message'), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'sub_type': FieldInfo(annotation=str, required=True), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

post_type: Literal['message']#
async reply(msg: T_KookMSG) Dict[str, Any][source]#

回复消息。

Parameters:

msg – 回复消息的内容,同 call_api() 方法。

Returns:

API 请求响应。

sub_type: str#
class iamai.adapter.kook.event.Meta(*, page: int | None = None, page_total: int | None = None, page_size: int | None = None, total: int | None = None)[source]#

Bases: BaseModel

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]] = {'page': FieldInfo(annotation=Union[int, NoneType], required=False), 'page_size': FieldInfo(annotation=Union[int, NoneType], required=False), 'page_total': FieldInfo(annotation=Union[int, NoneType], required=False), 'total': FieldInfo(annotation=Union[int, NoneType], required=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.

page: int | None#
page_size: int | None#
page_total: int | None#
total: int | None#
class iamai.adapter.kook.event.MetaEvent(*, adapter: Any, type: str | None, post_type: Literal['meta_event'], meta_event_type: str, **extra_data: Any)[source]#

Bases: OriginEvent

元事件

meta_event_type: str#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'meta_event_type': FieldInfo(annotation=str, required=True), 'post_type': FieldInfo(annotation=Literal['meta_event'], required=True), 'type': FieldInfo(annotation=Union[str, NoneType], 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.

post_type: Literal['meta_event']#
class iamai.adapter.kook.event.NoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: str, **extra_data: Any)[source]#

Bases: KookEvent

通知事件

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=str, required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: str#
post_type: Literal['notice']#
class iamai.adapter.kook.event.OriginEvent(*, adapter: Any, type: str | None, post_type: str, **extra_data: Any)[source]#

Bases: Event[KookAdapter]

为了区分信令中非Event事件,增加了前置OriginEvent

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'post_type': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], 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.

post_type: str#
class iamai.adapter.kook.event.PermissionOverwrite(*, role_id: int | None = None, allow: int | None = None, deny: int | None = None)[source]#

Bases: BaseModel

allow: int | None#
deny: int | None#
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]] = {'allow': FieldInfo(annotation=Union[int, NoneType], required=False), 'deny': FieldInfo(annotation=Union[int, NoneType], required=False), 'role_id': FieldInfo(annotation=Union[int, NoneType], required=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.

role_id: int | None#
class iamai.adapter.kook.event.PermissionUser(*, user: User | None = None, allow: int | None = None, deny: int | None = None)[source]#

Bases: BaseModel

allow: int | None#
deny: int | None#
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]] = {'allow': FieldInfo(annotation=Union[int, NoneType], required=False), 'deny': FieldInfo(annotation=Union[int, NoneType], required=False), 'user': FieldInfo(annotation=Union[User, NoneType], required=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.

user: User | None#
class iamai.adapter.kook.event.PrivateAddReactionEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['private_added_reaction'], **extra_data: Any)[source]#

Bases: PrivateNoticeEvent

私聊内用户添加 reaction

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['private_added_reaction'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['private_added_reaction']#
class iamai.adapter.kook.event.PrivateDeleteMessageEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['deleted_private_message'], **extra_data: Any)[source]#

Bases: PrivateNoticeEvent

私聊消息删除

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['deleted_private_message'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['deleted_private_message']#
class iamai.adapter.kook.event.PrivateDeleteReactionEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['private_deleted_reaction'], **extra_data: Any)[source]#

Bases: PrivateNoticeEvent

私聊内用户取消 reaction

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['private_deleted_reaction'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['private_deleted_reaction']#
class iamai.adapter.kook.event.PrivateMessageEvent(*, adapter: Any, type: str | None, post_type: Literal['message'] = 'message', channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, message_type: Literal['private'], sub_type: str, event: EventMessage, **extra_data: Any)[source]#

Bases: MessageEvent

私聊消息

message_type: Literal['private']#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'event': FieldInfo(annotation=EventMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'message_type': FieldInfo(annotation=Literal['private'], required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'post_type': FieldInfo(annotation=Literal['message'], required=False, default='message'), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'sub_type': FieldInfo(annotation=str, required=True), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

async reply(msg: T_KookMSG) Dict[str, Any][source]#

回复消息。

Parameters:

msg – 回复消息的内容,同 call_api() 方法。

Returns:

API 请求响应。

class iamai.adapter.kook.event.PrivateNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: str, **extra_data: Any)[source]#

Bases: NoticeEvent

私聊消息事件

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=str, required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

class iamai.adapter.kook.event.PrivateUpdateMessageEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['updated_private_message'], **extra_data: Any)[source]#

Bases: PrivateNoticeEvent

私聊消息更新

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['updated_private_message'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['updated_private_message']#
class iamai.adapter.kook.event.Quote(*, id: str | None = None, type: int | None = None, content: str | None = None, create_at: int | None = None, author: User | None = None)[source]#

Bases: BaseModel

引用消息

author: User | None#

作者的用户信息

content: str | None#

引用消息内容

create_at: int | None#

引用消息创建时间(毫秒)

id_: str | None#

引用消息 id

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]] = {'author': FieldInfo(annotation=Union[User, NoneType], required=False), 'content': FieldInfo(annotation=Union[str, NoneType], required=False), 'create_at': FieldInfo(annotation=Union[int, NoneType], required=False), 'id_': FieldInfo(annotation=Union[str, NoneType], required=False, alias='id', alias_priority=2), 'type': FieldInfo(annotation=Union[int, NoneType], required=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.

type: int | None#

引用消息类型

class iamai.adapter.kook.event.Reaction(*, emoji: Emoji | None = None, count: int | None = None, me: bool | None = None)[source]#

Bases: BaseModel

count: int | None#
emoji: Emoji | None#
me: bool | None#
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]] = {'count': FieldInfo(annotation=Union[int, NoneType], required=False), 'emoji': FieldInfo(annotation=Union[Emoji, NoneType], required=False), 'me': FieldInfo(annotation=Union[bool, NoneType], required=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.

class iamai.adapter.kook.event.ReactionUser(*, id: str | None = None, username: str | None = None, nickname: str | None = None, identify_num: str | None = None, online: bool | None = None, bot: bool | None = None, os: str | None = None, status: int | None = None, avatar: str | None = None, vip_avatar: str | None = None, mobile_verified: bool | None = None, roles: List[int] | None = None, joined_at: int | None = None, active_time: int | None = None, reaction_time: int | None = None)[source]#

Bases: User

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]] = {'active_time': FieldInfo(annotation=Union[int, NoneType], required=False), 'avatar': FieldInfo(annotation=Union[str, NoneType], required=False), 'bot': FieldInfo(annotation=Union[bool, NoneType], required=False), 'id_': FieldInfo(annotation=Union[str, NoneType], required=False, alias='id', alias_priority=2), 'identify_num': FieldInfo(annotation=Union[str, NoneType], required=False), 'joined_at': FieldInfo(annotation=Union[int, NoneType], required=False), 'mobile_verified': FieldInfo(annotation=Union[bool, NoneType], required=False), 'nickname': FieldInfo(annotation=Union[str, NoneType], required=False), 'online': FieldInfo(annotation=Union[bool, NoneType], required=False), 'os': FieldInfo(annotation=Union[str, NoneType], required=False), 'reaction_time': FieldInfo(annotation=Union[int, NoneType], required=False), 'roles': FieldInfo(annotation=Union[List[int], NoneType], required=False), 'status': FieldInfo(annotation=Union[int, NoneType], required=False), 'username': FieldInfo(annotation=Union[str, NoneType], required=False), 'vip_avatar': FieldInfo(annotation=Union[str, NoneType], required=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.

reaction_time: int | None#
class iamai.adapter.kook.event.ResultStore[source]#

Bases: object

classmethod get_sn(self_id: str) int[source]#
classmethod set_sn(self_id: str, sn: int) None[source]#
class iamai.adapter.kook.event.RolesReturn(*, meta: Meta | None = None, sort: Dict[str, Any] | None = None, items: List[Role] | None = None)[source]#

Bases: ListReturn

获取服务器角色列表返回信息

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]] = {'meta': FieldInfo(annotation=Union[Meta, NoneType], required=False), 'roles': FieldInfo(annotation=Union[List[Role], NoneType], required=False, alias='items', alias_priority=2), 'sort': FieldInfo(annotation=Union[Dict[str, Any], NoneType], required=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.

roles: List[Role] | None#

服务器角色列表

class iamai.adapter.kook.event.SelfExitGuildNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['self_exited_guild'], group_id: int, **extra_data: Any)[source]#

Bases: NoticeEvent

自己退出服务器

当自己被踢出服务器或被拉黑或主动退出服务器时, 产生该事件

group_id: int#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['self_exited_guild'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['self_exited_guild']#
user_id: str#
class iamai.adapter.kook.event.SelfJoinGuildNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['self_joined_guild'], group_id: int, **extra_data: Any)[source]#

Bases: NoticeEvent

自己新加入服务器

当自己被邀请或主动加入新的服务器时, 产生该事件

group_id: int#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['self_joined_guild'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['self_joined_guild']#
user_id: str#
class iamai.adapter.kook.event.SignalTypes(value)[source]#

Bases: IntEnum

信令类型 Kook 协议信令,字段与 Kook 一致。各事件字段参考 Kook 文档

EVENT = 0#
HELLO = 1#
PING = 2#
PONG = 3#
RECONNECT = 5#
RESUME = 4#
RESUME_ACK = 6#
SYS = 255#
class iamai.adapter.kook.event.TargetInfo(*, id: str | None = None, username: str | None = None, online: bool | None = None, avatar: str | None = None)[source]#

Bases: BaseModel

私聊会话 目标用户信息

avatar: str | None#

头像图片链接

id_: str | None#

目标用户 ID

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]] = {'avatar': FieldInfo(annotation=Union[str, NoneType], required=False), 'id_': FieldInfo(annotation=Union[str, NoneType], required=False, alias='id', alias_priority=2), 'online': FieldInfo(annotation=Union[bool, NoneType], required=False), 'username': FieldInfo(annotation=Union[str, NoneType], required=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.

online: bool | None#

是否在线

username: str | None#

目标用户名

class iamai.adapter.kook.event.URL(*, url: str | None = None)[source]#

Bases: BaseModel

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]] = {'url': FieldInfo(annotation=Union[str, NoneType], required=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.

url: str | None#

资源的 url

class iamai.adapter.kook.event.UserChat(*, code: str | None = None, last_read_time: int | None = None, latest_msg_time: int | None = None, unread_count: int | None = None, target_info: TargetInfo | None = None)[source]#

Bases: BaseModel

私聊会话

code: str | None#

私信会话 Code

last_read_time: int | None#

上次阅读消息的时间 (毫秒)

latest_msg_time: int | None#

最新消息时间 (毫秒)

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]] = {'code': FieldInfo(annotation=Union[str, NoneType], required=False), 'last_read_time': FieldInfo(annotation=Union[int, NoneType], required=False), 'latest_msg_time': FieldInfo(annotation=Union[int, NoneType], required=False), 'target_info': FieldInfo(annotation=Union[TargetInfo, NoneType], required=False), 'unread_count': FieldInfo(annotation=Union[int, NoneType], required=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.

target_info: TargetInfo | None#

目标用户信息

unread_count: int | None#

未读消息数

class iamai.adapter.kook.event.UserChatsReturn(*, meta: Meta | None = None, sort: Dict[str, Any] | None = None, items: List[UserChat] | None = None)[source]#

Bases: ListReturn

获取私信聊天会话列表返回信息

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]] = {'meta': FieldInfo(annotation=Union[Meta, NoneType], required=False), 'sort': FieldInfo(annotation=Union[Dict[str, Any], NoneType], required=False), 'user_chats': FieldInfo(annotation=Union[List[UserChat], NoneType], required=False, alias='items', alias_priority=2)}#

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

This replaces Model.__fields__ from Pydantic V1.

user_chats: List[UserChat] | None#

私聊会话列表

class iamai.adapter.kook.event.UserInfoUpdateNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['user_updated'], group_id: int, **extra_data: Any)[source]#

Bases: UserNoticeEvent

用户信息更新

该事件与服务器无关, 遵循以下条件:
  • 仅当用户的 用户名 或 头像 变更时

  • 仅通知与该用户存在关联的用户或 Bot
    1. 存在聊天会话

    2. 双方好友关系

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['user_updated'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['user_updated']#
class iamai.adapter.kook.event.UserJoinAudioChannelEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['exited_channel'], group_id: int, **extra_data: Any)[source]#

Bases: UserNoticeEvent

用户退出语音频道

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['exited_channel'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['exited_channel']#
class iamai.adapter.kook.event.UserJoinAudioChannelNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: Literal['joined_channel'], group_id: int, **extra_data: Any)[source]#

Bases: UserNoticeEvent

用户加入语音频道

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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=Literal['joined_channel'], required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

notice_type: Literal['joined_channel']#
class iamai.adapter.kook.event.UserNoticeEvent(*, adapter: Any, type: str | None, post_type: Literal['notice'], channel_type: Literal['PERSON', 'GROUP'], target_id: str, author_id: str | None = None, content: KookMessage, msg_id: str, msg_timestamp: int, nonce: str, extra: Extra, user_id: str, self_id: str | None = None, notice_type: str, group_id: int, **extra_data: Any)[source]#

Bases: NoticeEvent

用户相关事件列表

group_id: int#
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]] = {'adapter': FieldInfo(annotation=Any, required=True), 'author_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel_type': FieldInfo(annotation=Literal['PERSON', 'GROUP'], required=True), 'content': FieldInfo(annotation=KookMessage, required=True), 'extra': FieldInfo(annotation=Extra, required=True), 'group_id': FieldInfo(annotation=int, required=True), 'msg_id': FieldInfo(annotation=str, required=True), 'msg_timestamp': FieldInfo(annotation=int, required=True), 'nonce': FieldInfo(annotation=str, required=True), 'notice_type': FieldInfo(annotation=str, required=True), 'post_type': FieldInfo(annotation=Literal['notice'], required=True), 'self_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'target_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[str, NoneType], required=True), 'type_': FieldInfo(annotation=int, required=True, alias='type', alias_priority=2), 'user_id': 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.

iamai.adapter.kook.event.get_event_class(post_type: str, event_type: str, sub_type: str | None = None) Type[T_KookEvent][source]#

根据接收到的消息类型返回对应的事件类。

Parameters:
  • post_type – 请求类型。

  • event_type – 事件类型。

  • sub_type – 子类型。

Returns:

对应的事件类。