From 63ffb39d99994bd37923bb2c7d7feb923a6407ea Mon Sep 17 00:00:00 2001 From: c3b2a <62082214+c3b2a@users.noreply.github.com> Date: Thu, 4 Feb 2021 15:05:27 +0800 Subject: [PATCH] =?UTF-8?q?keyword=20bug=20=E4=BF=AE=E5=A4=8D=20(#110)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 再次修复重复发送的bug --- keyword.py | 7 ++----- list.json | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/keyword.py b/keyword.py index 0114c25..751b836 100644 --- a/keyword.py +++ b/keyword.py @@ -374,7 +374,6 @@ async def reply_set(context): async def auto_reply(context): if not redis_status(): return - global msg_rate, last_time chat_id = context.chat_id sender_id = context.sender_id if chat_id < 0: @@ -402,8 +401,6 @@ async def auto_reply(context): if could_reply: read_context[context.id] = None await send_reply(chat_id, parse_multi(v), context) - elif context.id in read_context: - del read_context[context.id] for k, v in regex_dict.items(): pattern = re.compile(k) if pattern.search(send_text) and context.id not in read_context: @@ -424,5 +421,5 @@ async def auto_reply(context): v = v.replace("${regex_%s}" % group_name, capture_data) count += 1 await send_reply(chat_id, parse_multi(v), context) - elif context.id in read_context: - del read_context[context.id] + if context.id in read_context: + del read_context[context.id] diff --git a/list.json b/list.json index abd76d5..bbfc7a3 100644 --- a/list.json +++ b/list.json @@ -362,10 +362,10 @@ }, { "name": "keyword", - "version": "2.02", + "version": "2.03", "section": "chat", "maintainer": "c3b2a", - "size": "17.4 kb", + "size": "17.3 kb", "supported": true, "des-short": "群组关键词自动回复插件", "des": "命令: keyword, replyset。"