mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-16 03:55:26 +00:00
✨ support ledger month info in stats
This commit is contained in:
parent
868de0798b
commit
0f1cb5ec69
@ -93,6 +93,10 @@ class PlayerStatsPlugins(Plugin):
|
||||
rogue = await client.get_starrail_rogue(uid)
|
||||
except SimnetBadRequest:
|
||||
rogue = None
|
||||
try:
|
||||
ledger = await client.get_starrail_ledger_month_info(uid)
|
||||
except SimnetBadRequest:
|
||||
ledger = None
|
||||
logger.debug(user_info)
|
||||
await self.set_name_card(uid, user_info.phone_background_image_url)
|
||||
data = {
|
||||
@ -113,6 +117,13 @@ class PlayerStatsPlugins(Plugin):
|
||||
("已解锁奇物", "unlocked_miracle_num"),
|
||||
("已解锁祝福", "unlocked_buff_num"),
|
||||
],
|
||||
"ledger": ledger,
|
||||
"ledger_labels": [
|
||||
("本月星琼", "current_hcoin"),
|
||||
("本月通专票", "current_rails_pass"),
|
||||
("上月星琼", "last_hcoin"),
|
||||
("上月通专票", "last_rails_pass"),
|
||||
],
|
||||
"style": "xianzhou", # nosec
|
||||
"avatar": (await self.head_icon.get_head_icon(uid)).as_uri(),
|
||||
"background": (await self.phone_theme.get_phone_theme(uid)).as_uri(),
|
||||
|
@ -54,6 +54,14 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if ledger %}
|
||||
{% for label, key in ledger_labels %}
|
||||
<div class="">
|
||||
<div class="text-xl box-stats">{{ ledger[key] }}</div>
|
||||
<div class="text-neutral-400 box-stats-label">{{ label }}</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="about text-center leading-8 text-xs opacity-50">
|
||||
|
Loading…
Reference in New Issue
Block a user