Add overview to command /challenge all

This commit is contained in:
Nahida 2024-03-11 09:09:59 +08:00 committed by GitHub
parent 017ac5f016
commit 01d008ab6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,5 @@
"""混沌回忆数据查询""" """混沌回忆数据查询"""
import asyncio import asyncio
import re import re
from functools import lru_cache from functools import lru_cache
@ -253,6 +254,11 @@ class ChallengePlugin(Plugin):
12: "#1D2A4A", 12: "#1D2A4A",
}, },
} }
overview = await self.template_service.render(
"starrail/abyss/overview.html", render_data, viewport={"width": 750, "height": 250}
)
if total: if total:
def floor_task(floor_index: int): def floor_task(floor_index: int):
@ -281,14 +287,12 @@ class ChallengePlugin(Plugin):
render_group_inputs = list(map(lambda x: x[1], sorted(render_inputs, key=lambda x: x[0]))) render_group_inputs = list(map(lambda x: x[1], sorted(render_inputs, key=lambda x: x[0])))
return await asyncio.gather(*render_group_inputs) render_group_outputs = await asyncio.gather(*render_group_inputs)
render_group_outputs.insert(0, overview)
return render_group_outputs
if floor < 1: if floor < 1:
return [ return [overview]
await self.template_service.render(
"starrail/abyss/overview.html", render_data, viewport={"width": 750, "height": 250}
)
]
try: try:
floor_data = abyss_data.floors[-floor] floor_data = abyss_data.floors[-floor]
except IndexError: except IndexError: