From ad635bd37da534e8286ae62dde32cfb349d82ba5 Mon Sep 17 00:00:00 2001 From: scdhh Date: Wed, 29 Nov 2023 10:59:58 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E4=BF=AE=E6=94=B9=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io_data_processor/__init__.py | 15 ++++++++------ .../top_data_processor/__init__.py | 15 ++++++++------ .../tos_data_processor/__init__.py | 20 +++++++++++-------- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/nonebot_plugin_tetris_stats/game_data_processor/io_data_processor/__init__.py b/nonebot_plugin_tetris_stats/game_data_processor/io_data_processor/__init__.py index 70828e4..be8dcd3 100644 --- a/nonebot_plugin_tetris_stats/game_data_processor/io_data_processor/__init__.py +++ b/nonebot_plugin_tetris_stats/game_data_processor/io_data_processor/__init__.py @@ -91,9 +91,10 @@ async def _(bot: Bot, event: Event, matcher: Matcher, account: User): command_args=[], ) try: - await matcher.finish(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id())) + await matcher.send(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id())) except NeedCatchError as e: - await matcher.finish(str(e)) + await matcher.send(str(e)) + raise @alc.assign('query') @@ -114,9 +115,10 @@ async def _(bot: Bot, event: Event, matcher: Matcher, target: At | Me): command_args=[], ) try: - await matcher.finish(message + await proc.handle_query()) + await matcher.send(message + await proc.handle_query()) except NeedCatchError as e: - await matcher.finish(str(e)) + await matcher.send(str(e)) + raise @alc.assign('query') @@ -127,9 +129,10 @@ async def _(event: Event, matcher: Matcher, account: User): command_args=[], ) try: - await matcher.finish(await proc.handle_query()) + await matcher.send(await proc.handle_query()) except NeedCatchError as e: - await matcher.finish(str(e)) + await matcher.send(str(e)) + raise @alc.assign('rank') diff --git a/nonebot_plugin_tetris_stats/game_data_processor/top_data_processor/__init__.py b/nonebot_plugin_tetris_stats/game_data_processor/top_data_processor/__init__.py index d631de7..a34ccc9 100644 --- a/nonebot_plugin_tetris_stats/game_data_processor/top_data_processor/__init__.py +++ b/nonebot_plugin_tetris_stats/game_data_processor/top_data_processor/__init__.py @@ -74,9 +74,10 @@ async def _(bot: Bot, event: Event, matcher: Matcher, account: User): command_args=[], ) try: - await matcher.finish(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id())) + await matcher.send(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id())) except NeedCatchError as e: - await matcher.finish(str(e)) + await matcher.send(str(e)) + raise @alc.assign('query') @@ -97,9 +98,10 @@ async def _(bot: Bot, event: Event, matcher: Matcher, target: At | Me): command_args=[], ) try: - await matcher.finish(message + await proc.handle_query()) + await matcher.send(message + await proc.handle_query()) except NeedCatchError as e: - await matcher.finish(str(e)) + await matcher.send(str(e)) + raise @alc.assign('query') @@ -110,9 +112,10 @@ async def _(event: Event, matcher: Matcher, account: User): command_args=[], ) try: - await matcher.finish(await proc.handle_query()) + await matcher.send(await proc.handle_query()) except NeedCatchError as e: - await matcher.finish(str(e)) + await matcher.send(str(e)) + raise add_default_handlers(alc) diff --git a/nonebot_plugin_tetris_stats/game_data_processor/tos_data_processor/__init__.py b/nonebot_plugin_tetris_stats/game_data_processor/tos_data_processor/__init__.py index 06bb6b6..2fee1de 100644 --- a/nonebot_plugin_tetris_stats/game_data_processor/tos_data_processor/__init__.py +++ b/nonebot_plugin_tetris_stats/game_data_processor/tos_data_processor/__init__.py @@ -84,9 +84,10 @@ try: command_args=[], ) try: - await matcher.finish(await proc.handle_query()) + await matcher.send(await proc.handle_query()) except NeedCatchError as e: - await matcher.finish(str(e)) + await matcher.send(str(e)) + raise except ImportError: pass @@ -99,9 +100,10 @@ async def _(bot: Bot, event: Event, matcher: Matcher, account: User): command_args=[], ) try: - await matcher.finish(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id())) + await matcher.send(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id())) except NeedCatchError as e: - await matcher.finish(str(e)) + await matcher.send(str(e)) + raise @alc.assign('query') @@ -122,9 +124,10 @@ async def _(bot: Bot, event: Event, matcher: Matcher, target: At | Me): command_args=[], ) try: - await matcher.finish(message + await proc.handle_query()) + await matcher.send(message + await proc.handle_query()) except NeedCatchError as e: - await matcher.finish(str(e)) + await matcher.send(str(e)) + raise @alc.assign('query') @@ -135,9 +138,10 @@ async def _(event: Event, matcher: Matcher, account: User): command_args=[], ) try: - await matcher.finish(await proc.handle_query()) + await matcher.send(await proc.handle_query()) except NeedCatchError as e: - await matcher.finish(str(e)) + await matcher.send(str(e)) + raise add_default_handlers(alc)