From 3ec8b96c021abaec6b1b80e55ce7af9fdad00406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Fri, 28 Apr 2023 14:42:19 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20the=20issue=20of=20`name?= =?UTF-8?q?=5Fcard`=20being=20replaced=20when=20it=20is=20not=20None?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/avatar_list.py | 2 +- plugins/tools/player_info.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/genshin/avatar_list.py b/plugins/genshin/avatar_list.py index f8464e08..0a4ac716 100644 --- a/plugins/genshin/avatar_list.py +++ b/plugins/genshin/avatar_list.py @@ -181,7 +181,7 @@ class AvatarListPlugin(Plugin): logger.warning("未找到角色 %s 的星级", player_info.hand_image) except Exception as exc: # pylint: disable=W0703 logger.error("卡片信息请求失败 %s", str(exc)) - if name_card is not None: # 默认 + if name_card is None: # 默认 name_card = (await self.assets_service.namecard(210001).navbar()).as_uri() return name_card, avatar, nickname, rarity diff --git a/plugins/tools/player_info.py b/plugins/tools/player_info.py index 90485d3b..5b995b0d 100644 --- a/plugins/tools/player_info.py +++ b/plugins/tools/player_info.py @@ -42,7 +42,7 @@ class PlayerInfoSystem(Plugin): logger.warning("未找到角色 %s 的等级", player_info.hand_image) except Exception as exc: # pylint: disable=W0703 logger.error("卡片信息请求失败 %s", str(exc)) - if name_card is not None: # 默认 + if name_card is None: # 默认 name_card = (await self.assets_service.namecard(210001).navbar()).as_uri() return name_card, avatar, nickname, rarity @@ -56,6 +56,6 @@ class PlayerInfoSystem(Plugin): name_card = (await self.assets_service.namecard(int(player_info.name_card)).navbar()).as_uri() except Exception as exc: # pylint: disable=W0703 logger.error("卡片信息请求失败 %s", str(exc)) - if name_card is not None: # 默认 + if name_card is None: # 默认 name_card = (await self.assets_service.namecard(210001).navbar()).as_uri() return name_card