From 9e11ed7d8ea7d7d9c1703afedc89354c0e1c715d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kotori=E3=81=AE=E3=81=AD=E3=81=93?= <2567702743@qq.com> Date: Fri, 2 Sep 2022 12:51:40 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E5=9B=9E=E5=A4=8D=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=98=B2=E6=B4=AA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jobs/sign.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jobs/sign.py b/jobs/sign.py index c72adab3..36911980 100644 --- a/jobs/sign.py +++ b/jobs/sign.py @@ -1,5 +1,6 @@ import datetime import time +import asyncio from aiohttp import ClientConnectorError from genshin import Game, GenshinException, AlreadyClaimed, InvalidCookies @@ -96,6 +97,7 @@ class SignJob: text = f"NOTICE {sign_db.user_id}\n\n{text}" try: await context.bot.send_message(sign_db.chat_id, text, parse_mode=ParseMode.HTML) + await asyncio.sleep(5) # 回复延迟5S避免触发洪水防御 except BadRequest as exc: Log.error(f"执行自动签到时发生错误 用户UID[{user_id}]", exc) sign_db.status = SignStatusEnum.BAD_REQUEST