🐛 Fix player card get caption when no weapon

This commit is contained in:
xtaodada 2024-04-26 10:42:19 +08:00
parent 45df5e2cc3
commit bf11cbed97
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -111,7 +111,7 @@ class PlayerCards(Plugin):
def get_caption(self, character: "Avatar") -> str:
tags = [idToRole(character.avatarId), f"等级{character.level}", f"命座{character.rank}"]
if equip := character.equipment:
weapon_detail = self.wiki_service.light_cone.get_by_id(equip.tid)
if weapon_detail := self.wiki_service.light_cone.get_by_id(equip.tid):
tags.append(weapon_detail.name)
tags.append(f"武器等级{equip.level}")
tags.append(f"{equip.rank}")