Skip to content

gacha 招募

招募信息处理模块。

python
from bestdori import gacha

类型定义

GachaInfo 招募信息

招募详细信息字典。 all.{index}.json 信息字典为该字典中选取部分字段信息。

字段名类型描述
gachaNameList[str | None]招募名定长列表
resourceNamestr资源库名称
bannerAssetBundleNamestr横幅图片资源库名称
publishedAtList[str | None]招募发布时间戳定长列表
typestr招募类型
newCardsList[int]新卡牌 ID 列表
closedAtList[str | None]招募结束时间戳定长列表
detailsList[Dict[str, Detail] | None]招募详细信息字典定长列表
rateList[Dict[str, Rate] | None]招募比率字典定长列表
paymentMethodsList[PaymentMethod]付费方式列表
descriptionList[str | None]招募描述定长列表
annotationList[str | None]招募注释定长列表
gachaPeriodList[str | None]招募时间戳定长列表
informationInformation招募信息

Detail 招募详细信息

字段名类型描述
rarityIndexint稀有度索引
weightint权重
pickupbool是否为 UP 卡

Rate 招募比率

字段名类型描述
ratefloat招募比率
weightTotalint权重总和

PaymentMethod 付费方式

字段名类型描述
gachaIdint招募 ID
paymentMethodstr付费方式
quantityint购买数量
paymentMethodIdint付费方式 ID
countint购买次数
behaviorstr购买行为
pickupbool是否为 UP 卡
costItemQuantityint消耗物品数量
discountTypeint折扣类型
ticketId NotRequiredint票券 ID

Information 招募信息

字段名类型描述
descriptionList[str | None]招募详细描述定长列表
termList[str | None]招募时期说明定长列表
newMemberInfoList[str | None]新成员说明定长列表
noticeList[str | None]招募备注信息定长列表

def get_all() async

参数名类型默认值描述
indexint0指定获取的 JSON 信息
me keywordOptional[Me]None登录用户类

获取总招募信息,返回以招募 ID 为字段名、 GachaAllInfo 为字段值的信息字典, GachaAllInfo 为从 GachaInfo 中截取出的部分信息。根据 index 参数值不同,获取到的 GachaAllInfo 所包含的信息也不同。

特别地,当 index 值为 0 时,返回值为以招募 ID 为字段名、 NoneDict 为字段值的字典

index 可用参数值
参数值获取字段值末项字段名
0-
1gachaName
3newCards
5closedAt
返回值: Dict[str, GachaAllInfo | NoneDict]

class Gacha()

招募类,包含各种招募相关资源整合。

def init()

参数名类型默认值描述
idint-招募 ID
me keywordOptional[Me]None登录用户类

def get_info() async

获取招募信息。

返回值: GachaInfo

def get_comment() async

参数名类型默认值描述
limitint20获取到的帖子数量上限
offsetint0获取帖子时的偏移量
orderOrder'TIME_ASC'

获取招募的社区评论列表。

返回值: PostList

def get_banner() async

参数名类型默认值描述
serverServerName-服务器名

获取招募缩略图资源。

返回值: bytes

def get_pickups() async

参数名类型默认值描述
serverServerName-服务器名

获取招募 pickup 图像资源。

返回值: List[bytes]

def get_logo() async

参数名类型默认值描述
serverServerName-服务器名

获取招募 LOGO 图像资源。

返回值: bytes