Skip to content

logincampaigns 登录奖励

登录奖励信息获取模块。

python
from bestdori import logincampaigns

类型定义

LoginCampaignInfo 登录奖励信息

登录奖励信息字典。 all.{index}.json 信息字典为该字典中选取部分字段信息。

字段名类型描述
captionList[str | None]登录奖励标题定长列表
loginBonusTypestr登录奖励类型
assetBundleNameList[str | None]资源库名称定长列表
publishedAtList[str | None]开始时间戳定长列表
closedAtList[str | None]结束时间戳定长列表
assetMapDict[str, Any]资源信息字典
detailsList[List[Detail] | None]登录奖励详情定长列表

Detail 登录奖励详情

字段名类型描述
loginBonusIdint登录奖励 ID
daysint登录奖励天数
resourceTypestr登录奖励资源类型
resourceIdint登录奖励资源 ID
quantityint登录奖励数量
voideId NotRequiredint登录奖励语音 ID
seqint登录奖励序号
grantTypestr登录奖励类型

def get_all() async

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

获取总登录奖励信息,返回以登录奖励 ID 为字段名、 LoginCampaignsAllInfo 为字段值的信息字典, LoginCampaignsAllInfo 为从 LoginCampaignInfo 中截取出的部分信息。根据 index 参数值不同,获取到的 LoginCampaignsAllInfo 所包含的信息也不同。

特别地,当 index 值为 0 时,返回值为以登录奖励 ID 为字段名、 NoneDict 为字段值的字典

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

class LoginCampaigns()

登录奖励类,包含各种登录奖励相关资源整合。

def init()

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

def get_info() async

获取登录奖励信息。

返回值: LoginCampaignInfo

def get_comment() async

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

获取登录奖励的社区评论列表。

返回值: PostList

def get_background() async

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

获取登录奖励背景图像资源。

返回值: bytes