From 7a3a4d936d0ee39527ebfa7f1b4833846021a9a7 Mon Sep 17 00:00:00 2001 From: shoucandanghehe Date: Sun, 13 Oct 2024 00:38:37 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E6=AD=A3=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=20trigger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_tetris_stats/games/tetrio/query.py | 4 ++-- nonebot_plugin_tetris_stats/games/tetrio/rank/all.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nonebot_plugin_tetris_stats/games/tetrio/query.py b/nonebot_plugin_tetris_stats/games/tetrio/query.py index f06c78f..88bfe00 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/query.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/query.py @@ -104,7 +104,7 @@ async def _( # noqa: PLR0913 session_persist_id=await get_session_persist_id(event_session), game_platform=GAME_TYPE, command_type='query', - command_args=[f'--default-template {template}'] if template is not None else [], + command_args=[f'--template {template}'] if template is not None else [], ): async with get_session() as session: bind = await query_bind_info( @@ -131,7 +131,7 @@ async def _(user: NBUser, account: Player, event_session: EventSession, template session_persist_id=await get_session_persist_id(event_session), game_platform=GAME_TYPE, command_type='query', - command_args=[f'--default-template {template}'] if template is not None else [], + command_args=[f'--template {template}'] if template is not None else [], ): async with get_session() as session: if template is None: diff --git a/nonebot_plugin_tetris_stats/games/tetrio/rank/all.py b/nonebot_plugin_tetris_stats/games/tetrio/rank/all.py index 0dce643..7baacb6 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/rank/all.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/rank/all.py @@ -32,12 +32,12 @@ command.add( @alc.assign('TETRIO.rank.all') -async def _(event_session: EventSession, template: Template = 'v1'): +async def _(event_session: EventSession, template: Template | None = None): async with trigger( session_persist_id=await get_session_persist_id(event_session), game_platform=GAME_TYPE, command_type='rank', - command_args=['--all'], + command_args=['--all'] + ([f'--template {template}'] if template is not None else []), ): async with get_session() as session: latest_data = ( @@ -62,7 +62,7 @@ async def _(event_session: EventSession, template: Template = 'v1'): ) ).one() match template: - case 'v1': + case 'v1' | None: await UniMessage.image(raw=await make_image_v1(latest_data, compare_data)).finish() case 'v2': await UniMessage.image(raw=await make_image_v2(latest_data, compare_data)).finish()