costumes 服装
服装信息获取模块。
python
from bestdori import costumes类型定义
CostumeInfo 服装信息
角色详细信息字典。all.{index}.json 信息字典为该字典中选取部分字段信息。
| 字段名 | 类型 | 描述 |
|---|---|---|
| characterId | int | 服装对应角色 ID |
| assetBundleName | str | 服装资源库名 |
| description | List[str | None] | 服装描述定长列表 |
| publishedAt | List[str | None] | 服装上线时间时间戳定长列表 |
| sdResourceName | str | 服装 LIVESD 资源库名 |
| howToGet | List[str | None] | 服装获取方法定长列表 |
| cards | List[int] | 服装对应卡牌 ID 列表 |
def get_all() async
| 参数名 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| index | int | 0 | 指定获取的 JSON 信息 |
| me keyword | Optional[Me] | None | 登录用户类 |
获取总服装信息,返回以服装 ID 为字段名、 CostumesAllInfo 为字段值的信息字典, CostumesAllInfo 为从 CostumeInfo 中截取出的部分信息。根据 index 参数值不同,获取到的 CostumesAllInfo 所包含的信息也不同。
特别地,当 index 值为 0 时,返回值为以服装 ID 为字段名、 NoneDict 为字段值的字典
index 可用参数值
| 参数值 | 获取字段值末项字段名 |
|---|---|
| 0 | - |
| 5 | publishedAt |
Dict[str, CostumesAllInfo | NoneDict]class Costume()
服装类,包含各种服装相关资源整合。
def init()
| 参数名 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| id | int | - | 服装 ID |
| me keyword | Optional[Me] | None | 登录用户类 |
def get_info() async
获取服装信息。
返回值:CostumeInfodef get_comment() async
| 参数名 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| limit | int | 20 | 获取到的帖子数量上限 |
| offset | int | 0 | 获取帖子时的偏移量 |
| order | Order | 'TIME_ASC' |
获取服装的社区评论列表。
返回值:PostListdef get_sdchara() async
获取服装 LIVESD 图片资源。
返回值:bytesdef get_build_data() async
获取服装 Live2D 模型资源。
返回值:bytesdef get_icon() async
获取服装图标资源。
返回值:bytes