Skip to content

Commit

Permalink
🎨 Request Daily Reward Again When Status is NEED_CHALLENGE
Browse files Browse the repository at this point in the history
  • Loading branch information
luoshuijs committed Feb 5, 2023
1 parent f0689b9 commit 7924698
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions plugins/jobs/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ async def sign(self, context: CallbackContext):
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)
Expand All @@ -87,12 +88,10 @@ async def sign(self, context: CallbackContext):
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}]")
Expand Down

0 comments on commit 7924698

Please sign in to comment.