🐛 练度统计对旅行者特殊判断

This commit is contained in:
xtaodada 2022-10-16 19:39:42 +08:00
parent 4a0168d311
commit 3b1a46837d
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -108,6 +108,9 @@ 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
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}")
@ -123,6 +126,9 @@ 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
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