From 3b1a46837dc406b7891afdd169d25c68b063de1e Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 16 Oct 2022 19:39:42 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E7=BB=83=E5=BA=A6=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=AF=B9=E6=97=85=E8=A1=8C=E8=80=85=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/avatar_list.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/genshin/avatar_list.py b/plugins/genshin/avatar_list.py index ab84e4b3..a3a21069 100644 --- a/plugins/genshin/avatar_list.py +++ b/plugins/genshin/avatar_list.py @@ -108,7 +108,10 @@ class AvatarListPlugin(Plugin, BasePlugin): namecard = (await self.assets_service.namecard(response.player.namecard.id).navbar()).as_uri() avatar = (await self.assets_service.avatar(response.player.icon.id).icon()).as_uri() nickname = response.player.nickname - rarity = {k: v["rank"] for k, v in AVATAR_DATA.items()}[str(response.player.icon.id)] + if response.player.icon.id in [10000005, 10000007]: + rarity = 5 + else: + rarity = {k: v["rank"] for k, v in AVATAR_DATA.items()}[str(response.player.icon.id)] except Exception as e: # pylint: disable=W0703 logger.debug(f"enka 请求失败: {e}") choices = ArkoWrapper(characters).filter(lambda x: x.friendship == 10) # 筛选出好感满了的角色 @@ -123,7 +126,10 @@ class AvatarListPlugin(Plugin, BasePlugin): namecard = (await self.assets_service.namecard(namecard_choices[0]).navbar()).as_uri() avatar = (await self.assets_service.avatar(cid := choices[0].id).icon()).as_uri() nickname = update.effective_user.full_name - rarity = {k: v["rank"] for k, v in AVATAR_DATA.items()}[str(cid)] + if cid in [10000005, 10000007]: + rarity = 5 + else: + rarity = {k: v["rank"] for k, v in AVATAR_DATA.items()}[str(cid)] return namecard, avatar, nickname, rarity @handler.command("avatars", filters.Regex(r"^/avatars\s*(?:(\d+)|(all))?$"))