mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-25 01:29:49 +00:00
🐛 Fix default namecard navbar not found
This commit is contained in:
parent
3936c14d00
commit
f57d6760ac
@ -392,6 +392,9 @@ class _NamecardAssets(_AssetsService):
|
|||||||
profile: ICON_TYPE
|
profile: ICON_TYPE
|
||||||
"""个人资料名片背景"""
|
"""个人资料名片背景"""
|
||||||
|
|
||||||
|
NAME_CARD_DEFAULT: int = 210189
|
||||||
|
"""默认名片 ID"""
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def game_name(self) -> str:
|
def game_name(self) -> str:
|
||||||
return NAMECARD_DATA[str(self.id)]["icon"]
|
return NAMECARD_DATA[str(self.id)]["icon"]
|
||||||
@ -410,6 +413,8 @@ class _NamecardAssets(_AssetsService):
|
|||||||
raise ValueError(avatar_id)
|
raise ValueError(avatar_id)
|
||||||
|
|
||||||
def __call__(self, target: int) -> "_NamecardAssets":
|
def __call__(self, target: int) -> "_NamecardAssets":
|
||||||
|
if target == 0:
|
||||||
|
target = self.NAME_CARD_DEFAULT
|
||||||
result = _NamecardAssets(self.client)
|
result = _NamecardAssets(self.client)
|
||||||
target = int(target) if not isinstance(target, int) else target
|
target = int(target) if not isinstance(target, int) else target
|
||||||
if target > 10000000:
|
if target > 10000000:
|
||||||
|
@ -151,7 +151,7 @@ class AvatarListPlugin(Plugin):
|
|||||||
except Exception as exc: # pylint: disable=W0703
|
except Exception as exc: # pylint: disable=W0703
|
||||||
logger.error("卡片信息请求失败 %s", str(exc))
|
logger.error("卡片信息请求失败 %s", str(exc))
|
||||||
if name_card is None: # 默认
|
if name_card is None: # 默认
|
||||||
name_card = (await self.assets_service.namecard(210001).navbar()).as_uri()
|
name_card = (await self.assets_service.namecard(0).navbar()).as_uri()
|
||||||
return name_card, avatar, nickname, rarity
|
return name_card, avatar, nickname, rarity
|
||||||
|
|
||||||
@handler.command("avatars", cookie=True, block=False)
|
@handler.command("avatars", cookie=True, block=False)
|
||||||
|
@ -43,7 +43,7 @@ class PlayerInfoSystem(Plugin):
|
|||||||
except Exception as exc: # pylint: disable=W0703
|
except Exception as exc: # pylint: disable=W0703
|
||||||
logger.error("卡片信息请求失败 %s", str(exc))
|
logger.error("卡片信息请求失败 %s", str(exc))
|
||||||
if name_card is None: # 默认
|
if name_card is None: # 默认
|
||||||
name_card = (await self.assets_service.namecard(210001).navbar()).as_uri()
|
name_card = (await self.assets_service.namecard(0).navbar()).as_uri()
|
||||||
return name_card, avatar, nickname, rarity
|
return name_card, avatar, nickname, rarity
|
||||||
|
|
||||||
async def get_name_card(self, player_id: int, user_id: int):
|
async def get_name_card(self, player_id: int, user_id: int):
|
||||||
@ -56,5 +56,5 @@ class PlayerInfoSystem(Plugin):
|
|||||||
except Exception as exc: # pylint: disable=W0703
|
except Exception as exc: # pylint: disable=W0703
|
||||||
logger.error("卡片信息请求失败 %s", str(exc))
|
logger.error("卡片信息请求失败 %s", str(exc))
|
||||||
if name_card is None: # 默认
|
if name_card is None: # 默认
|
||||||
name_card = (await self.assets_service.namecard(210001).navbar()).as_uri()
|
name_card = (await self.assets_service.namecard(0).navbar()).as_uri()
|
||||||
return name_card
|
return name_card
|
||||||
|
Loading…
Reference in New Issue
Block a user