From e32a4c6e99a2bce57c8b59e7bb24025619215aa4 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Fri, 7 Oct 2022 00:41:38 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E5=A2=9E=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E6=96=AD=20log=20=E6=96=87=E4=BB=B6=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/system/log.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/system/log.py b/plugins/system/log.py index 3f366e8..22c0a2d 100644 --- a/plugins/system/log.py +++ b/plugins/system/log.py @@ -20,11 +20,11 @@ class Log(Plugin): user = update.effective_user logger.info(f"用户 {user.full_name}[{user.id}] send_log 命令请求") message = update.effective_message - if os.path.exists(error_log): + if os.path.exists(error_log) and os.path.getsize(error_log) > 0: await message.reply_document(open(error_log, mode='rb+'), caption="Error Log") else: await message.reply_text("错误日记未找到") - if os.path.exists(debug_log): + if os.path.exists(debug_log) and os.path.getsize(debug_log) > 0: await message.reply_document(open(debug_log, mode='rb+'), caption="Debug Log") else: await message.reply_text("调试日记未找到")