From c58f124f0c8c93262bdb79c5935adcf29f8507de Mon Sep 17 00:00:00 2001 From: shoucandanghehe Date: Sun, 16 Jun 2024 09:02:29 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E5=91=BD=E4=BB=A4=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E8=AE=B0=E5=BD=95=E6=B7=BB=E5=8A=A0=E4=B8=A4=E7=A7=8D?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_tetris_stats/db/__init__.py | 4 ++-- nonebot_plugin_tetris_stats/db/models.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nonebot_plugin_tetris_stats/db/__init__.py b/nonebot_plugin_tetris_stats/db/__init__.py index 5d208ae..76908c7 100644 --- a/nonebot_plugin_tetris_stats/db/__init__.py +++ b/nonebot_plugin_tetris_stats/db/__init__.py @@ -92,7 +92,7 @@ async def anti_duplicate_add(cls: type[T], model: T) -> None: async def trigger( session_persist_id: int, game_platform: Literal['IO'], - command_type: CommandType | Literal['rank'], + command_type: CommandType | Literal['rank', 'config', 'record'], command_args: list[str], ) -> AsyncGenerator: yield @@ -113,7 +113,7 @@ async def trigger( async def trigger( session_persist_id: int, game_platform: GameType, - command_type: CommandType | Literal['rank'], + command_type: CommandType | Literal['rank', 'config', 'record'], command_args: list[str], ) -> AsyncGenerator: trigger_time = datetime.now(UTC) diff --git a/nonebot_plugin_tetris_stats/db/models.py b/nonebot_plugin_tetris_stats/db/models.py index 3f63add..dd66195 100644 --- a/nonebot_plugin_tetris_stats/db/models.py +++ b/nonebot_plugin_tetris_stats/db/models.py @@ -76,6 +76,6 @@ class TriggerHistoricalData(MappedAsDataclass, Model): trigger_time: Mapped[datetime] = mapped_column(DateTime) session_persist_id: Mapped[int] game_platform: Mapped[GameType] = mapped_column(String(32), index=True) - command_type: Mapped[CommandType | Literal['rank']] = mapped_column(String(16), index=True) + command_type: Mapped[CommandType | Literal['rank', 'config', 'record']] = mapped_column(String(16), index=True) command_args: Mapped[list[str]] = mapped_column(JSON) finish_time: Mapped[datetime] = mapped_column(DateTime)