mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 15:36:44 +00:00
🐛 Fix abyss
not handling TooManyRequestPublicCookies
exception correctly
This commit is contained in:
parent
3c4b24bf25
commit
79272ab330
@ -127,10 +127,13 @@ class Abyss(Plugin, BasePlugin):
|
|||||||
extra={"markup": True},
|
extra={"markup": True},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
try:
|
try:
|
||||||
client = await get_genshin_client(user.id)
|
client = await get_genshin_client(user.id)
|
||||||
await client.get_record_cards()
|
await client.get_record_cards()
|
||||||
uid = client.uid
|
uid = client.uid
|
||||||
|
except CookiesNotFoundError:
|
||||||
|
client, uid = await get_public_genshin_client(user.id)
|
||||||
except UserNotFoundError: # 若未找到账号
|
except UserNotFoundError: # 若未找到账号
|
||||||
buttons = [[InlineKeyboardButton("点我绑定账号", url=f"https://t.me/{context.bot.username}?start=set_uid")]]
|
buttons = [[InlineKeyboardButton("点我绑定账号", url=f"https://t.me/{context.bot.username}?start=set_uid")]]
|
||||||
if filters.ChatType.GROUPS.filter(message):
|
if filters.ChatType.GROUPS.filter(message):
|
||||||
@ -143,8 +146,6 @@ class Abyss(Plugin, BasePlugin):
|
|||||||
else:
|
else:
|
||||||
await message.reply_text("未查询到您所绑定的账号信息,请先绑定账号", reply_markup=InlineKeyboardMarkup(buttons))
|
await message.reply_text("未查询到您所绑定的账号信息,请先绑定账号", reply_markup=InlineKeyboardMarkup(buttons))
|
||||||
return
|
return
|
||||||
except CookiesNotFoundError: # 若未找到cookie
|
|
||||||
client, uid = await get_public_genshin_client(user.id)
|
|
||||||
except TooManyRequestPublicCookies:
|
except TooManyRequestPublicCookies:
|
||||||
reply_msg = await message.reply_text("查询次数太多,请您稍后重试")
|
reply_msg = await message.reply_text("查询次数太多,请您稍后重试")
|
||||||
if filters.ChatType.GROUPS.filter(message):
|
if filters.ChatType.GROUPS.filter(message):
|
||||||
|
Loading…
Reference in New Issue
Block a user