From a2aa8fbdc927fd88dcbe38ff951f9f639a226eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Sun, 18 Sep 2022 16:16:33 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E7=BB=99=E6=97=A5=E8=AE=B0?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=B7=BB=E5=8A=A0=E6=93=8D=E4=BD=9C=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/system/log.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/system/log.py b/plugins/system/log.py index d386720..dc4ac50 100644 --- a/plugins/system/log.py +++ b/plugins/system/log.py @@ -5,6 +5,7 @@ from telegram.ext import CommandHandler, CallbackContext from core.plugin import Plugin, handler from utils.decorators.admins import bot_admins_rights_check +from utils.log import logger current_dir = os.getcwd() error_log = os.path.join(current_dir, "logs", "error", "error.log") @@ -16,6 +17,8 @@ class Log(Plugin): @handler(CommandHandler, command="send_log", block=False) @bot_admins_rights_check async def send_log(self, update: Update, _: CallbackContext): + user = update.effective_user + logger.info(f"用户 {user.full_name}[{user.id}] send_log命令请求") message = update.effective_message if os.path.exists(error_log): await message.reply_document(open(error_log, mode='rb+'), caption="Error Log")