From 730186cfd402fff52e3d9abdec1af213639037f9 Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Thu, 8 Jul 2021 23:05:24 +0800 Subject: [PATCH] :zap: remove optional param --- .../nonebot/adapters/feishu/message.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/nonebot-adapter-feishu/nonebot/adapters/feishu/message.py b/packages/nonebot-adapter-feishu/nonebot/adapters/feishu/message.py index debf26e7..e1c748db 100644 --- a/packages/nonebot-adapter-feishu/nonebot/adapters/feishu/message.py +++ b/packages/nonebot-adapter-feishu/nonebot/adapters/feishu/message.py @@ -60,11 +60,8 @@ class MessageSegment(BaseMessageSegment["Message"]): #接收消息 @staticmethod - def at(user_id: str, user_name: str) -> "MessageSegment": - return MessageSegment("at", { - "user_id": user_id, - "user_name": user_name - }) + def at(user_id: str) -> "MessageSegment": + return MessageSegment("at", {"user_id": user_id}) #发送消息 @staticmethod @@ -199,9 +196,12 @@ class MessageSerializer: else: if last_segment_type == "image": msg["content"].append([]) - msg["content"][-1].append({"tag": segment.type, **segment.data}) + msg["content"][-1].append({ + "tag": segment.type if segment.type != "image" else "img", + **segment.data + }) last_segment_type = segment.type - return "post", json.dumps(msg) + return "post", json.dumps({"zh_cn": {**msg}}) else: return self.message[0].type, json.dumps(self.message[0].data)