PamGram/modules/wiki/models/avatar_config.py

40 lines
673 B
Python
Raw Normal View History

2023-04-28 12:03:38 +00:00
from typing import List, Optional
2023-04-27 12:25:06 +00:00
from pydantic import BaseModel
class AvatarName(BaseModel):
Hash: int
class AvatarConfig(BaseModel):
name: str = ""
AvatarID: int
AvatarName: AvatarName
AvatarVOTag: str
class AvatarIcon(BaseModel):
id: int
"""角色ID"""
name: str
"""名称"""
icon: List[str]
"""图标(从小到大)"""
@property
def gacha(self) -> str:
2023-04-28 12:03:38 +00:00
return self.icon[3]
2023-04-27 12:25:06 +00:00
@property
def icon_(self) -> str:
return self.icon[0]
@property
2023-04-28 12:03:38 +00:00
def square(self) -> Optional[str]:
2023-04-27 12:25:06 +00:00
return self.icon[1]
2023-04-28 12:03:38 +00:00
@property
def normal(self) -> str:
return self.icon[2]