From d9cc912ccb899379b533d55ca7b92b9921d7adfd Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Tue, 14 Sep 2021 21:48:58 +0800 Subject: [PATCH] :boom: use `open_id` to send private message instead --- .../nonebot-adapter-feishu/nonebot/adapters/feishu/bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nonebot-adapter-feishu/nonebot/adapters/feishu/bot.py b/packages/nonebot-adapter-feishu/nonebot/adapters/feishu/bot.py index 5f11cf71..4ca04685 100644 --- a/packages/nonebot-adapter-feishu/nonebot/adapters/feishu/bot.py +++ b/packages/nonebot-adapter-feishu/nonebot/adapters/feishu/bot.py @@ -331,16 +331,16 @@ class Bot(BaseBot): msg = message if isinstance(message, Message) else Message(message) if isinstance(event, GroupMessageEvent): - receive_id, receive_id_type = event.event.message.chat_id, 'chat_id' + receive_id, receive_id_type = event.event.message.chat_id, "chat_id" elif isinstance(event, PrivateMessageEvent): - receive_id, receive_id_type = event.get_user_id(), 'union_id' + receive_id, receive_id_type = event.get_user_id(), "open_id" else: raise ValueError( "Cannot guess `receive_id` and `receive_id_type` to reply!") at_sender = at_sender and bool(event.get_user_id()) - if at_sender and receive_id_type != "union_id": + if at_sender and receive_id_type == "chat_id": msg = MessageSegment.at(event.get_user_id()) + " " + msg msg_type, content = MessageSerializer(msg).serialize()