From fe95e689bcbfe03499acb1649c331b2cb605945f Mon Sep 17 00:00:00 2001 From: EillesWan Date: Sun, 11 Aug 2024 11:30:41 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B1=E2=80=8D=F0=9F=91=A4=E6=8B=89?= =?UTF-8?q?=E6=A0=BC=E5=85=B0=E6=9C=89=E7=82=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trimo_plugin_msctconverter/msctexec.py | 20 ++++++++++++------- .../trimo_plugin_msctconverter/mspvexec.py | 1 + 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/plugins/trimo_plugin_msctconverter/msctexec.py b/src/plugins/trimo_plugin_msctconverter/msctexec.py index b9aaff5..de1e2e9 100644 --- a/src/plugins/trimo_plugin_msctconverter/msctexec.py +++ b/src/plugins/trimo_plugin_msctconverter/msctexec.py @@ -238,7 +238,7 @@ async def _(): except: pass - query_convert_points(qqid,"music",0,False) + query_convert_points(qqid, "music", 0, False) filesaves[qqid]["totalSize"] -= filesaves[qqid][name]["size"] nonebot.logger.info( "\t删除{}".format(name), @@ -971,23 +971,29 @@ async def _( Musicreater.plugin.archive.compress_zipfile( usr_temp_path, fp := str( - temporary_dir - / ( - fn := "msctr[{}]-{}.zip".format( - utime_hanzify(zhDateTime.DateTime.now().to_lunar()), usr_id + ( + temporary_dir + / ( + fn := "msctr[{}]-{}.zip".format( + utime_hanzify(zhDateTime.DateTime.now().to_lunar()), usr_id + ) ) - ) + ).resolve() ), ) shutil.rmtree(usr_temp_path) + # await linglun_convert.send(UniMessage.file(name=fn, path=fp)) + if isinstance(event, GroupMessageEvent) or isinstance( event, GroupUploadNoticeEvent ): - await bot.call_api( + res_id = await bot.call_api( "upload_group_file", group_id=event.group_id, name=fn, file=fp ) + await linglun_convert.send(UniMessage.text("文件已上传群文件,请在群文件查看。")) + # await linglun_convert.send(UniMessage.file(res_id,path=fp,name=fn)) else: await bot.call_api( "upload_private_file", user_id=event.user_id, name=fn, file=fp diff --git a/src/plugins/trimo_plugin_msctconverter/mspvexec.py b/src/plugins/trimo_plugin_msctconverter/mspvexec.py index ac597dd..f8ddbc8 100644 --- a/src/plugins/trimo_plugin_msctconverter/mspvexec.py +++ b/src/plugins/trimo_plugin_msctconverter/mspvexec.py @@ -413,6 +413,7 @@ async def _( await bot.call_api( "upload_group_file", group_id=event.group_id, name=fn, file=fp ) + await mspv_sync.send(UniMessage.text("文件已上传群文件,请在群文件查看。")) else: await bot.call_api( "upload_private_file", user_id=event.user_id, name=fn, file=fp