From eb481e71188acba3cd9c1724a7cbccca0c06b35b Mon Sep 17 00:00:00 2001 From: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Date: Mon, 6 Jun 2022 23:19:58 +0800 Subject: [PATCH] =?UTF-8?q?pmcaptcha=20=E5=BF=BD=E7=95=A5=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=B6=88=E6=81=AF=20(#8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.json | 2 +- pmcaptcha/main.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/list.json b/list.json index d663003..ab9d905 100644 --- a/list.json +++ b/list.json @@ -72,7 +72,7 @@ }, { "name": "pmcaptcha", - "version": "1.01", + "version": "1.011", "section": "chat", "maintainer": "cloudreflection", "size": "9.33 kb", diff --git a/pmcaptcha/main.py b/pmcaptcha/main.py index 480feb0..36a8c56 100644 --- a/pmcaptcha/main.py +++ b/pmcaptcha/main.py @@ -38,9 +38,9 @@ async def process_pm_captcha(client: Client, message: Message): cid = message.chat.id data = sqlite.get("pmcaptcha", {}) if not captcha_success.check_id(cid) and sqlite.get("pmcaptcha." + str(cid)) is None: - # 忽略联系人和服务消息 - if message.from_user.is_contact or message.from_user.id == 777000: - return captcha_success.add_id(cid) + # 忽略联系人、服务消息、机器人消息 + if message.from_user.is_contact or message.from_user.id == 777000 or message.chat.type == ChatType.BOT: + return await client.read_chat_history(message.chat.id) if data.get("blacklist", "") and message.text is not None: for i in data.get("blacklist", "").split(","):