From b8f952d4628ee915b1d11e245020f5a29ce305a8 Mon Sep 17 00:00:00 2001 From: daycat <88031959+daycat@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:56:13 +0800 Subject: [PATCH] =?UTF-8?q?pmcaptcha=20=E4=B8=AD=E7=BB=86=E5=BE=AE?= =?UTF-8?q?=E7=9A=84=E8=8B=B1=E8=AF=AD=E8=AF=AD=E6=B3=95=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=20(#11)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.json | 2 +- pmcaptcha/main.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/list.json b/list.json index 73bf0fd..a198dc4 100644 --- a/list.json +++ b/list.json @@ -72,7 +72,7 @@ }, { "name": "pmcaptcha", - "version": "1.141", + "version": "1.142", "section": "chat", "maintainer": "cloudreflection", "size": "13 kb", diff --git a/pmcaptcha/main.py b/pmcaptcha/main.py index cabdfaf..08646ae 100644 --- a/pmcaptcha/main.py +++ b/pmcaptcha/main.py @@ -103,7 +103,7 @@ async def process_pm_captcha(client: Client, message: Message): cid = message.chat.id data = sqlite.get("pmcaptcha", {}) if data.get('disable', False) and not captcha_success.check_id(cid): - await message.reply('对方已设置禁止私聊,您已被封禁\n\nYou are not allowed to send private messages to me and been banned') + await message.reply('对方已设置禁止私聊,您已被封禁\n\nThe recipient is blocking all private messages. You are now blocked.') await do_action_and_read(client, cid, data) return if ( @@ -114,7 +114,7 @@ async def process_pm_captcha(client: Client, message: Message): if data.get("blacklist", False) and message.text is not None: for i in data.get("blacklist", "").split(","): if i in message.text: - await message.reply('您触犯了黑名单规则,已被封禁\n\nYou have violated the blacklist rules and been banned') + await message.reply('您触犯了黑名单规则,已被封禁\n\nYou are blocked because of a blacklist violation') await do_action_and_read(client, cid, data) try: await client.invoke(UpdateNotifySettings(peer=InputNotifyPeer(peer=await client.resolve_peer(cid)), @@ -130,14 +130,14 @@ async def process_pm_captcha(client: Client, message: Message): sqlite[f'pmcaptcha.{str(cid)}'] = str(key1 + key2) msg = await message.reply( '已启用私聊验证。请发送 \"' + str(key1) + '+' + str(key2) + '\" 的答案(阿拉伯数字)来与我私聊\n请在' + str(wait) + - '秒内完成验证。您只有一次验证机会\n\nHuman verification is enabled.Please send the answer of this question \"' + - str(key1) + '+' + str(key2) + '\" (numbers only) first.\nYou have ' + str(wait) + - ' seconds to complete the verification.') + '秒内完成验证。您只有一次验证机会\n\nPlease answer the following question to prove you are human: \"' + + str(key1) + '+' + str(key2) + '\"\nYou have ' + str(wait) + + ' seconds and only one chance to answer.') await asyncio.sleep(wait) await msg.safe_delete() # noqa if sqlite.get(f'pmcaptcha.{str(cid)}') is not None: del sqlite[f'pmcaptcha.{str(cid)}'] - await message.reply('验证超时,您已被封禁\n\nVerification timeout.You have been banned.') + await message.reply('验证超时,您已被封禁\n\nYou failed provide an answer in time. You are now blocked.') await do_action_and_read(client, cid, data) elif sqlite.get(f"pmcaptcha.{str(cid)}"): if message.text == sqlite.get(f"pmcaptcha.{str(cid)}"): @@ -150,14 +150,14 @@ async def process_pm_captcha(client: Client, message: Message): except: # noqa pass await asyncio.sleep(random.randint(0, 100) / 1000) - await message.reply(data.get("welcome", "验证通过\n\nVerification Passed")) + await message.reply(data.get("Welcome", "验证通过\n\nYou have passed the captcha.")) await asyncio.sleep(random.randint(0, 100) / 1000) await client.unarchive_chats(chat_ids=cid) data['pass'] = data.get('pass', 0) + 1 sqlite['pmcaptcha'] = data else: del sqlite[f'pmcaptcha.{str(cid)}'] - await message.reply('验证错误,您已被封禁\n\nVerification failed.You have been banned.') + await message.reply('验证错误,您已被封禁\n\nYou provided an incorrect answer. You are now blocked.') await do_action_and_read(client, cid, data)