From da2b28c27de0c3c5ac5a926153bb704b2ace8b46 Mon Sep 17 00:00:00 2001 From: EillesWan Date: Sat, 9 Nov 2024 13:57:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E6=B5=8B=E4=BD=A0=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nonebot_plugins/trimo_plugin_msctconverter/msctexec.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nonebot_plugins/trimo_plugin_msctconverter/msctexec.py b/src/nonebot_plugins/trimo_plugin_msctconverter/msctexec.py index fe511b3..30c6c5c 100644 --- a/src/nonebot_plugins/trimo_plugin_msctconverter/msctexec.py +++ b/src/nonebot_plugins/trimo_plugin_msctconverter/msctexec.py @@ -428,7 +428,7 @@ async def _( file_subtype: str = os.path.splitext(file_infomation["name"])[-1].lower() if file_subtype in cache_limit_data.keys(): - + if (file_infomation["size"] > cache_limit_data[file_subtype][0]) and common_permission: await notece_.finish( "文件 {} 大小过大,这不是网盘\n单个{}文件不应大于 {} 千字节".format( @@ -714,6 +714,7 @@ linglun_convert = on_alconna( Option( "-fa|--forward-axis", default="z+", args=Args["forward-axis", str, "z+"] ), + Option("--debug", default=False, action=store_true), ), # permission=SUPERUSER, ) @@ -770,6 +771,7 @@ async def _( "height-limit": 32, "author": "Eilles", "forward-axis": "z+", + "debug": False, } for arg in _args.keys(): _args[arg] = ( @@ -1137,6 +1139,8 @@ async def _( buffer.write( "[ERROR] {}\n".format(e).replace(str(Path(__file__).parent.resolve()), "[]") ) + if _args["debug"]: + raise e sys.stdout = sys.__stdout__ sys.stderr = sys.__stderr__