keyword bug 修复 (#110)

再次修复重复发送的bug
This commit is contained in:
c3b2a 2021-02-04 15:05:27 +08:00 committed by GitHub
parent 40d06a0c16
commit 63ffb39d99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -374,7 +374,6 @@ async def reply_set(context):
async def auto_reply(context): async def auto_reply(context):
if not redis_status(): if not redis_status():
return return
global msg_rate, last_time
chat_id = context.chat_id chat_id = context.chat_id
sender_id = context.sender_id sender_id = context.sender_id
if chat_id < 0: if chat_id < 0:
@ -402,8 +401,6 @@ async def auto_reply(context):
if could_reply: if could_reply:
read_context[context.id] = None read_context[context.id] = None
await send_reply(chat_id, parse_multi(v), context) 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(): for k, v in regex_dict.items():
pattern = re.compile(k) pattern = re.compile(k)
if pattern.search(send_text) and context.id not in read_context: 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) v = v.replace("${regex_%s}" % group_name, capture_data)
count += 1 count += 1
await send_reply(chat_id, parse_multi(v), context) await send_reply(chat_id, parse_multi(v), context)
elif context.id in read_context: if context.id in read_context:
del read_context[context.id] del read_context[context.id]

View File

@ -362,10 +362,10 @@
}, },
{ {
"name": "keyword", "name": "keyword",
"version": "2.02", "version": "2.03",
"section": "chat", "section": "chat",
"maintainer": "c3b2a", "maintainer": "c3b2a",
"size": "17.4 kb", "size": "17.3 kb",
"supported": true, "supported": true,
"des-short": "群组关键词自动回复插件", "des-short": "群组关键词自动回复插件",
"des": "命令: keyword, replyset。" "des": "命令: keyword, replyset。"