mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 04:35:49 +00:00
🐛 Fix handle CookiesCachePoolExhausted gracefully
This commit is contained in:
parent
58f1ecc857
commit
5ea80e0218
@ -15,7 +15,7 @@ from telegram.helpers import escape_markdown
|
|||||||
|
|
||||||
from core.basemodel import RegionEnum
|
from core.basemodel import RegionEnum
|
||||||
from core.plugin import Plugin, conversation, handler
|
from core.plugin import Plugin, conversation, handler
|
||||||
from core.services.cookies.error import TooManyRequestPublicCookies
|
from core.services.cookies.error import TooManyRequestPublicCookies, CookiesCachePoolExhausted
|
||||||
from core.services.cookies.services import CookiesService, PublicCookiesService
|
from core.services.cookies.services import CookiesService, PublicCookiesService
|
||||||
from core.services.players.models import PlayersDataBase as Player, PlayerInfoSQLModel
|
from core.services.players.models import PlayersDataBase as Player, PlayerInfoSQLModel
|
||||||
from core.services.players.services import PlayersService, PlayerInfoService
|
from core.services.players.services import PlayersService, PlayerInfoService
|
||||||
@ -137,6 +137,9 @@ class BindAccountPlugin(Plugin.Conversation):
|
|||||||
except TooManyRequestPublicCookies:
|
except TooManyRequestPublicCookies:
|
||||||
await message.reply_text("用户查询次数过多,请稍后重试", reply_markup=ReplyKeyboardRemove())
|
await message.reply_text("用户查询次数过多,请稍后重试", reply_markup=ReplyKeyboardRemove())
|
||||||
return ConversationHandler.END
|
return ConversationHandler.END
|
||||||
|
except CookiesCachePoolExhausted:
|
||||||
|
await message.reply_text("公共Cookies池已经耗尽,请稍后重试或者绑定 cookie", reply_markup=ReplyKeyboardRemove())
|
||||||
|
return ConversationHandler.END
|
||||||
if region == RegionEnum.HYPERION:
|
if region == RegionEnum.HYPERION:
|
||||||
client = GenshinClient(cookies=cookies.data, region=Region.CHINESE)
|
client = GenshinClient(cookies=cookies.data, region=Region.CHINESE)
|
||||||
elif region == RegionEnum.HOYOLAB:
|
elif region == RegionEnum.HOYOLAB:
|
||||||
|
Loading…
Reference in New Issue
Block a user