mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 07:07:46 +00:00
🎨 回复增加防洪处理
This commit is contained in:
parent
320fadc5cb
commit
9e11ed7d8e
@ -1,5 +1,6 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import time
|
import time
|
||||||
|
import asyncio
|
||||||
|
|
||||||
from aiohttp import ClientConnectorError
|
from aiohttp import ClientConnectorError
|
||||||
from genshin import Game, GenshinException, AlreadyClaimed, InvalidCookies
|
from genshin import Game, GenshinException, AlreadyClaimed, InvalidCookies
|
||||||
@ -96,6 +97,7 @@ class SignJob:
|
|||||||
text = f"<a href=\"tg://user?id={sign_db.user_id}\">NOTICE {sign_db.user_id}</a>\n\n{text}"
|
text = f"<a href=\"tg://user?id={sign_db.user_id}\">NOTICE {sign_db.user_id}</a>\n\n{text}"
|
||||||
try:
|
try:
|
||||||
await context.bot.send_message(sign_db.chat_id, text, parse_mode=ParseMode.HTML)
|
await context.bot.send_message(sign_db.chat_id, text, parse_mode=ParseMode.HTML)
|
||||||
|
await asyncio.sleep(5) # 回复延迟5S避免触发洪水防御
|
||||||
except BadRequest as exc:
|
except BadRequest as exc:
|
||||||
Log.error(f"执行自动签到时发生错误 用户UID[{user_id}]", exc)
|
Log.error(f"执行自动签到时发生错误 用户UID[{user_id}]", exc)
|
||||||
sign_db.status = SignStatusEnum.BAD_REQUEST
|
sign_db.status = SignStatusEnum.BAD_REQUEST
|
||||||
|
Loading…
Reference in New Issue
Block a user