🎨 ask set cookies when public request failed

This commit is contained in:
xtaodada 2023-10-01 20:37:19 +08:00
parent 235f9f349e
commit a778f78c8a
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
3 changed files with 6 additions and 8 deletions

View File

@ -216,12 +216,12 @@ class BindAccountPlugin(Plugin.Conversation):
return ConversationHandler.END
except InvalidCookies:
await self.public_cookies_service.undo(user.id, cookies, CookiesStatusEnum.INVALID_COOKIES)
await message.reply_text("出错了呜呜呜 ~ 请稍后重试")
await message.reply_text("出错了呜呜呜 ~ 请稍后重试或者绑定 cookie")
return ConversationHandler.END
except SimnetBadRequest as exc:
if exc.ret_code == 1034:
await self.public_cookies_service.undo(user.id)
await message.reply_text("出错了呜呜呜 ~ 请稍后重试")
await message.reply_text("出错了呜呜呜 ~ 请稍后重试或者绑定 cookie")
return ConversationHandler.END
await message.reply_text("获取账号信息发生错误", reply_markup=ReplyKeyboardRemove())
logger.error("获取账号信息发生错误")

View File

@ -134,9 +134,8 @@ class AbyssPlugin(Plugin):
async with self.helper.public_genshin(user.id) as client:
images = await self.get_rendered_pic(client, uid, floor, total, previous)
except SimnetBadRequest as exc:
if exc.ret_code == 1034 and client.player_id != uid:
await message.reply_text("出错了呜呜呜 ~ 请稍后重试")
return
if exc.ret_code == 1034 and uid and uid != client.player_id:
raise CookiesNotFoundError(uid) from exc
raise exc
except AbyssUnlocked: # 若深渊未解锁
await message.reply_text("还未解锁深渊哦~")

View File

@ -53,9 +53,8 @@ class PlayerStatsPlugins(Plugin):
async with self.helper.public_genshin(user.id) as client:
render_result = await self.render(client, uid)
except SimnetBadRequest as exc:
if exc.ret_code == 1034 and uid:
await message.reply_text("出错了呜呜呜 ~ 请稍后重试")
return
if exc.ret_code == 1034 and uid and uid != client.player_id:
raise CookiesNotFoundError(uid) from exc
raise exc
except TooManyRequestPublicCookies:
await message.reply_text("用户查询次数过多 请稍后重试")