Merge pull request #788 from zouyonghe/dev/nested-forward

支持嵌套转发
This commit is contained in:
邹永赫
2025-03-12 08:50:50 +09:00
committed by GitHub
+6 -2
View File
@@ -353,16 +353,20 @@ class Node(BaseMessageComponent):
id: T.Optional[int] = 0 # 忽略
name: T.Optional[str] = "" # qq昵称
uin: T.Optional[int] = 0 # qq号
content: T.Optional[T.Union[str, list]] = "" # 子消息段列表
content: T.Optional[T.Union[str, list, dict]] = "" # 子消息段列表
seq: T.Optional[T.Union[str, list]] = "" # 忽略
time: T.Optional[int] = 0
def __init__(self, content: T.Union[str, list], **_):
def __init__(self, content: T.Union[str, list, dict, "Node"], **_):
if isinstance(content, list):
_content = ""
for chain in content:
_content += chain.toString()
content = _content
elif isinstance(content, Node):
content = content.toDict()
else:
content = content
super().__init__(content=content, **_)
def toString(self):