TETR.IO 添加 list 命令

This commit is contained in:
2024-06-28 15:07:48 +08:00
parent 34c857387e
commit aacf518004
9 changed files with 166 additions and 12 deletions

View File

@@ -11,7 +11,7 @@ from nonebot_plugin_orm import AsyncSession, get_session
from nonebot_plugin_user import User # type: ignore[import-untyped]
from sqlalchemy import select
from ..utils.typing import CommandType, GameType
from ..utils.typing import AllCommandType, BaseCommandType, GameType, TETRIOCommandType
from .models import Bind, TriggerHistoricalData
UTC = timezone.utc
@@ -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', 'config', 'record'],
command_type: TETRIOCommandType,
command_args: list[str],
) -> AsyncGenerator:
yield
@@ -103,7 +103,7 @@ async def trigger(
async def trigger(
session_persist_id: int,
game_platform: GameType,
command_type: CommandType,
command_type: BaseCommandType,
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', 'config', 'record'],
command_type: AllCommandType,
command_args: list[str],
) -> AsyncGenerator:
trigger_time = datetime.now(UTC)