mirror of https://github.com/Mai-with-u/MaiBot.git
fix: 修复chatstream中的userinfo和groupinfo初始化
parent
6dbee3dc56
commit
a2acb56ee6
|
|
@ -47,8 +47,8 @@ class ChatStream:
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls, data: dict) -> "ChatStream":
|
def from_dict(cls, data: dict) -> "ChatStream":
|
||||||
"""从字典创建实例"""
|
"""从字典创建实例"""
|
||||||
user_info = UserInfo(**data.get("user_info", {})) if data.get("user_info") else None
|
user_info = UserInfo.from_dict(data.get("user_info", {})) if data.get("user_info") else None
|
||||||
group_info = GroupInfo(**data.get("group_info", {})) if data.get("group_info") else None
|
group_info = GroupInfo.from_dict(data.get("group_info", {})) if data.get("group_info") else None
|
||||||
|
|
||||||
return cls(
|
return cls(
|
||||||
stream_id=data["stream_id"],
|
stream_id=data["stream_id"],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue