From cecc497ac99e3371ebad7d72995abad818842153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Mon, 6 Feb 2023 00:12:08 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Request=20Daily=20Reward=20Again?= =?UTF-8?q?=20When=20Status=20is=20`NEED=5FCHALLENGE`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/jobs/sign.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/jobs/sign.py b/plugins/jobs/sign.py index ee6579f2..98ebd483 100644 --- a/plugins/jobs/sign.py +++ b/plugins/jobs/sign.py @@ -72,12 +72,13 @@ class SignJob(Plugin): text = "签到失败了呜呜呜 ~ 服务器连接超时 服务器熟啦 ~ " sign_db.status = SignStatusEnum.TIMEOUT_ERROR except ClientConnectorError as exc: - logger.warning(f"aiohttp 请求错误 {repr(exc)}") + logger.warning("aiohttp 请求错误 %s", str(exc)) text = "签到失败了呜呜呜 ~ 链接服务器发生错误 服务器熟啦 ~ " sign_db.status = SignStatusEnum.TIMEOUT_ERROR except NeedChallenge: - text = "签到失败,触发验证码风控,自动签到自动关闭" - sign_db.status = SignStatusEnum.NEED_CHALLENGE + text = "签到失败,触发验证码风控" + if context.job.name == "SignAgainJob": + sign_db.status = SignStatusEnum.NEED_CHALLENGE except Exception as exc: logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]") logger.exception(exc) @@ -87,12 +88,10 @@ class SignJob(Plugin): try: await context.bot.send_message(sign_db.chat_id, text, parse_mode=ParseMode.HTML) except BadRequest as exc: - logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]") - logger.exception(exc) + logger.error("执行自动签到时发生错误 message[%s] user_id[%s]", exc.message, user_id) sign_db.status = SignStatusEnum.BAD_REQUEST except Forbidden as exc: - logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]") - logger.exception(exc) + logger.error("执行自动签到时发生错误 message[%s] user_id[%s]", exc.message, user_id) sign_db.status = SignStatusEnum.FORBIDDEN except Exception as exc: logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")