mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-16 03:55:26 +00:00
🐛 Fix handle CookiesCachePoolExhausted gracefully
This commit is contained in:
parent
f1918e80fb
commit
82b478160c
@ -15,7 +15,7 @@ from telegram.helpers import escape_markdown
|
||||
|
||||
from core.basemodel import RegionEnum
|
||||
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.players.models import PlayersDataBase as Player, PlayerInfoSQLModel
|
||||
from core.services.players.services import PlayersService, PlayerInfoService
|
||||
@ -137,6 +137,9 @@ class BindAccountPlugin(Plugin.Conversation):
|
||||
except TooManyRequestPublicCookies:
|
||||
await message.reply_text("用户查询次数过多,请稍后重试", reply_markup=ReplyKeyboardRemove())
|
||||
return ConversationHandler.END
|
||||
except CookiesCachePoolExhausted:
|
||||
await message.reply_text("公共Cookies池已经耗尽,请稍后重试或者绑定 cookie", reply_markup=ReplyKeyboardRemove())
|
||||
return ConversationHandler.END
|
||||
if region == RegionEnum.HYPERION:
|
||||
client = StarRailClient(cookies=cookies.data, region=Region.CHINESE, lang="zh-cn")
|
||||
elif region == RegionEnum.HOYOLAB:
|
||||
|
Loading…
Reference in New Issue
Block a user