From c89a475e848982c4d262b1ac22b9e0d655258407 Mon Sep 17 00:00:00 2001 From: LD_EPYC Date: Mon, 6 Mar 2023 12:33:28 +0800 Subject: [PATCH] update logiv for chatkey --- basic/task.py | 1 - client/wxclient.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/basic/task.py b/basic/task.py index f5c3247..7309f8d 100644 --- a/basic/task.py +++ b/basic/task.py @@ -45,7 +45,6 @@ def play(self): ): self.reply += data["message"][len(self.reply):] - elif self.type == "c": print("ask:" + self.prompt) for data in self.bot.ask( diff --git a/client/wxclient.py b/client/wxclient.py index 2ffb296..bed00c0 100644 --- a/client/wxclient.py +++ b/client/wxclient.py @@ -132,14 +132,14 @@ def handle_recv_txt_msg(j): elif stableDiffRly and ( (content.startswith(privateImgKey) and not is_room) or (content.startswith(groupImgKey) and is_room)): - content = re.sub("^" + (privateImgKey if content.startswith(privateImgKey) else groupImgKey), + content = re.sub("^" + (groupImgKey if is_room else privateImgKey), "", content, 1) ig = ImgTask(ws, content, wx_id, room_id, is_room, "2.1") img_que.put(ig) elif (content.startswith(privateChatKey) and not is_room) or (content.startswith(groupChatKey) and is_room): - content = re.sub("^" + (privateChatKey if content.startswith(privateChatKey) else groupChatKey), "", + content = re.sub("^" + (groupChatKey if is_room else privateChatKey), "", content, 1) if chatbot is None: