mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-16 03:55:26 +00:00
🐛 Fix player card get caption when no weapon
This commit is contained in:
parent
45df5e2cc3
commit
bf11cbed97
@ -111,10 +111,10 @@ 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)
|
||||
tags.append(weapon_detail.name)
|
||||
tags.append(f"武器等级{equip.level}")
|
||||
tags.append(f"精{equip.rank}")
|
||||
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}")
|
||||
return "#" + " #".join(tags)
|
||||
|
||||
@handler.command(command="player_card", player=True, block=False)
|
||||
|
Loading…
Reference in New Issue
Block a user