diff --git a/nonebot_plugin_all4one/middlewares/onebot_v11.py b/nonebot_plugin_all4one/middlewares/onebot_v11.py index 6d46f97..4a319de 100644 --- a/nonebot_plugin_all4one/middlewares/onebot_v11.py +++ b/nonebot_plugin_all4one/middlewares/onebot_v11.py @@ -167,14 +167,14 @@ async def to_onebot_message(self, message: Message) -> OneBotMessage: resp = await self.bot.get_forward_msg(id=segment.data["id"]) nodes = [] for node in resp["message"]: - if node.type == "forward": + if node["type"] == "forward": continue nodes.append( { "user_id": node["data"]["user_id"], "user_name": node["data"]["nickname"], "message": await self.to_onebot_message( - node["data"]["content"] + Message(node["data"]["content"]) ), } ) @@ -226,7 +226,7 @@ async def from_onebot_message(self, message: OneBotMessage) -> Message: "name": node["user_name"], "uin": node["user_id"], "content": await self.from_onebot_message( - node["message"] + OneBotMessage(node["message"]) ), }, )