From 98db3fe755831e24f59707cc96d5538a5319d923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Sat, 7 Jan 2023 15:27:00 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Update=20Handle=20`InvalidCookie?= =?UTF-8?q?s`=20Exception?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/avatar_list.py | 4 ++-- plugins/genshin/ledger.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/genshin/avatar_list.py b/plugins/genshin/avatar_list.py index 2eb136e0..52d0d51c 100644 --- a/plugins/genshin/avatar_list.py +++ b/plugins/genshin/avatar_list.py @@ -249,14 +249,14 @@ class AvatarListPlugin(Plugin, BasePlugin): await notice.delete() await client.get_genshin_user(client.uid) logger.warning("用户 %s[%s] 无法请求角色数数据 API返回信息为 [%s]%s", user.full_name, user.id, exc.retcode, exc.original) - reply_message = await message.reply_text("出错了呜呜呜 ~ 当前账号无法请求角色数数据。\n请尝试登录通行证,在账号管理里面选择账号游戏信息,将原神设置为默认角色。") + reply_message = await message.reply_text("出错了呜呜呜 ~ 当前访问令牌无法请求角色数数据,请尝试重新获取Cookie。") if filters.ChatType.GROUPS.filter(message): self._add_delete_message_job(context, reply_message.chat_id, reply_message.message_id, 30) self._add_delete_message_job(context, message.chat_id, message.message_id, 30) return except GenshinException as e: + await notice.delete() if e.retcode == -502002: - await notice.delete() reply_message = await message.reply_html("请先在米游社中使用一次养成计算器后再使用此功能~") self._add_delete_message_job(context, reply_message.chat_id, reply_message.message_id, 20) return diff --git a/plugins/genshin/ledger.py b/plugins/genshin/ledger.py index d9350599..5493405b 100644 --- a/plugins/genshin/ledger.py +++ b/plugins/genshin/ledger.py @@ -130,9 +130,7 @@ class Ledger(Plugin, BasePlugin): logger.warning( "用户 %s[%s] 无法请求旅行札记数据 API返回信息为 [%s]%s", user.full_name, user.id, exc.retcode, exc.original ) - reply_message = await message.reply_text( - "出错了呜呜呜 ~ 当前账号无法请求旅行札记数据。\n请尝试登录通行证,在账号管理里面选择账号游戏信息,将原神设置为默认角色。" - ) + reply_message = await message.reply_text("出错了呜呜呜 ~ 当前访问令牌无法请求角色数数据,请尝试重新获取Cookie。") if filters.ChatType.GROUPS.filter(message): self._add_delete_message_job(context, reply_message.chat_id, reply_message.message_id, 30) self._add_delete_message_job(context, message.chat_id, message.message_id, 30)