mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
✨ 更新 TETR.IO 模板 (#348)
* ✨ 更新路径以匹配模板 * ✨ 添加历史数据 * 🎨 优化模板模型代码结构 --------- Co-authored-by: shoucandanghehe <wallfjjd@gmail.com>
This commit is contained in:
@@ -5,10 +5,10 @@ from nonebot.compat import PYDANTIC_V2
|
||||
|
||||
from ..templates import templates_dir
|
||||
from .schemas.bind import Bind
|
||||
from .schemas.tetrio_info import Info as TETRIOInfo
|
||||
from .schemas.tetrio_info_v2 import Info as TETRIOInfoV2
|
||||
from .schemas.tetrio_record_blitz import Record as TETRIORecordBlitz
|
||||
from .schemas.tetrio_record_sprint import Record as TETRIORecordSprint
|
||||
from .schemas.tetrio.tetrio_info import Info as TETRIOInfo
|
||||
from .schemas.tetrio.tetrio_record_blitz import Record as TETRIORecordBlitz
|
||||
from .schemas.tetrio.tetrio_record_sprint import Record as TETRIORecordSprint
|
||||
from .schemas.tetrio.tetrio_user_info_v2 import Info as TETRIOUserInfoV2
|
||||
from .schemas.top_info import Info as TOPInfo
|
||||
from .schemas.tos_info import Info as TOSInfo
|
||||
|
||||
@@ -34,7 +34,7 @@ async def render(render_type: Literal['v1/tos/info'], data: TOSInfo) -> str: ...
|
||||
|
||||
|
||||
@overload
|
||||
async def render(render_type: Literal['v2/tetrio/info'], data: TETRIOInfoV2) -> str: ...
|
||||
async def render(render_type: Literal['v2/tetrio/user/info'], data: TETRIOUserInfoV2) -> str: ...
|
||||
|
||||
|
||||
@overload
|
||||
@@ -51,11 +51,11 @@ async def render(
|
||||
'v1/tetrio/info',
|
||||
'v1/top/info',
|
||||
'v1/tos/info',
|
||||
'v2/tetrio/info',
|
||||
'v2/tetrio/user/info',
|
||||
'v2/tetrio/record/40l',
|
||||
'v2/tetrio/record/blitz',
|
||||
],
|
||||
data: Bind | TETRIOInfo | TOPInfo | TOSInfo | TETRIOInfoV2 | TETRIORecordSprint | TETRIORecordBlitz,
|
||||
data: Bind | TETRIOInfo | TOPInfo | TOSInfo | TETRIOUserInfoV2 | TETRIORecordSprint | TETRIORecordBlitz,
|
||||
) -> str:
|
||||
if PYDANTIC_V2:
|
||||
return await env.get_template('index.html').render_async(
|
||||
|
||||
Reference in New Issue
Block a user