mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 09:37:30 +00:00
🐛 Fix KeyError caused by improper parameter type for character star level retrieval
This commit is contained in:
parent
3ec8b96c02
commit
007ef28d0b
@ -176,7 +176,7 @@ class AvatarListPlugin(Plugin):
|
|||||||
if player_info.hand_image is not None:
|
if player_info.hand_image is not None:
|
||||||
avatar = (await self.assets_service.avatar(player_info.hand_image).icon()).as_uri()
|
avatar = (await self.assets_service.avatar(player_info.hand_image).icon()).as_uri()
|
||||||
try:
|
try:
|
||||||
rarity = {k: v["rank"] for k, v in AVATAR_DATA.items()}[player_info.hand_image]
|
rarity = {k: v["rank"] for k, v in AVATAR_DATA.items()}[str(player_info.hand_image)]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
logger.warning("未找到角色 %s 的星级", player_info.hand_image)
|
logger.warning("未找到角色 %s 的星级", player_info.hand_image)
|
||||||
except Exception as exc: # pylint: disable=W0703
|
except Exception as exc: # pylint: disable=W0703
|
||||||
|
@ -37,7 +37,7 @@ class PlayerInfoSystem(Plugin):
|
|||||||
if player_info.hand_image is not None:
|
if player_info.hand_image is not None:
|
||||||
avatar = (await self.assets_service.avatar(player_info.hand_image).icon()).as_uri()
|
avatar = (await self.assets_service.avatar(player_info.hand_image).icon()).as_uri()
|
||||||
try:
|
try:
|
||||||
rarity = {k: v["rank"] for k, v in AVATAR_DATA.items()}[player_info.hand_image]
|
rarity = {k: v["rank"] for k, v in AVATAR_DATA.items()}[str(player_info.hand_image)]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
logger.warning("未找到角色 %s 的等级", player_info.hand_image)
|
logger.warning("未找到角色 %s 的等级", player_info.hand_image)
|
||||||
except Exception as exc: # pylint: disable=W0703
|
except Exception as exc: # pylint: disable=W0703
|
||||||
|
Loading…
Reference in New Issue
Block a user