Skip to content

Commit b24075f

Browse files
committed
在 Json.to_dict 中 使用 self.type.lower() 来推导
1 parent 3075337 commit b24075f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

astrbot/core/message/components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,12 +653,12 @@ async def to_dict(self) -> dict:
653653
# 如果原始数据是字符串,使用 content 包装形式
654654
if self.raw_data is not None:
655655
return {
656-
"type": "json",
656+
"type": self.type.lower(),
657657
"data": {"content": self.raw_data},
658658
}
659659
# 如果原始数据是字典,直接返回原始字典结构
660660
return {
661-
"type": "json",
661+
"type": self.type.lower(),
662662
"data": self.data,
663663
}
664664

0 commit comments

Comments
 (0)