diff --git a/nonebot_plugin_tetris_stats/games/__init__.py b/nonebot_plugin_tetris_stats/games/__init__.py index ca4ede1..773b856 100644 --- a/nonebot_plugin_tetris_stats/games/__init__.py +++ b/nonebot_plugin_tetris_stats/games/__init__.py @@ -9,15 +9,17 @@ from nonebot_plugin_alconna import AlcMatches, Alconna, At, CommandMeta, on_alco from .. import ns from ..utils.exception import MessageFormatError, NeedCatchError -alc = on_alconna( - Alconna( - ['tetris-stats', 'tstats'], - namespace=ns, - meta=CommandMeta( - description='俄罗斯方块相关游戏数据查询', - fuzzy_match=True, - ), +command: Alconna = Alconna( + ['tetris-stats', 'tstats'], + namespace=ns, + meta=CommandMeta( + description='俄罗斯方块相关游戏数据查询', + fuzzy_match=True, ), +) + +alc = on_alconna( + command=command, skip_for_unmatch=False, auto_send_output=True, use_origin=True, diff --git a/nonebot_plugin_tetris_stats/games/tetrio/__init__.py b/nonebot_plugin_tetris_stats/games/tetrio/__init__.py index 8fb065b..c20f700 100644 --- a/nonebot_plugin_tetris_stats/games/tetrio/__init__.py +++ b/nonebot_plugin_tetris_stats/games/tetrio/__init__.py @@ -3,7 +3,7 @@ from nonebot_plugin_alconna import At from ...utils.exception import MessageFormatError from ...utils.typing import Me -from .. import add_block_handlers, alc +from .. import add_block_handlers, alc, command from .api import Player from .api.typing import ValidRank from .constant import USER_ID, USER_NAME @@ -18,7 +18,7 @@ def get_player(user_id_or_name: str) -> Player | MessageFormatError: return MessageFormatError('用户名/ID不合法') -alc.command.add( +command.add( Subcommand( 'TETR.IO', Subcommand( diff --git a/nonebot_plugin_tetris_stats/games/top/__init__.py b/nonebot_plugin_tetris_stats/games/top/__init__.py index 9dbffbd..72439b2 100644 --- a/nonebot_plugin_tetris_stats/games/top/__init__.py +++ b/nonebot_plugin_tetris_stats/games/top/__init__.py @@ -3,7 +3,7 @@ from nonebot_plugin_alconna import At from ...utils.exception import MessageFormatError from ...utils.typing import Me -from .. import add_block_handlers, alc +from .. import add_block_handlers, alc, command from .api import Player from .constant import USER_NAME @@ -14,7 +14,7 @@ def get_player(name: str) -> Player | MessageFormatError: return MessageFormatError('用户名/ID不合法') -alc.command.add( +command.add( Subcommand( 'TOP', Subcommand( diff --git a/nonebot_plugin_tetris_stats/games/tos/__init__.py b/nonebot_plugin_tetris_stats/games/tos/__init__.py index 0e27025..f986da8 100644 --- a/nonebot_plugin_tetris_stats/games/tos/__init__.py +++ b/nonebot_plugin_tetris_stats/games/tos/__init__.py @@ -3,7 +3,7 @@ from nonebot_plugin_alconna import At from ...utils.exception import MessageFormatError from ...utils.typing import Me -from .. import add_block_handlers, alc +from .. import add_block_handlers, alc, command from .api import Player from .constant import USER_NAME @@ -19,7 +19,7 @@ def get_player(teaid_or_name: str) -> Player | MessageFormatError: return MessageFormatError('用户名/ID不合法') -alc.command.add( +command.add( Subcommand( 'TOS', Subcommand(