From b706a0de8daf1931a71eed0b3583d202b3775da5 Mon Sep 17 00:00:00 2001 From: UnCLAS-Prommer Date: Sun, 16 Mar 2025 10:21:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=AA=E6=96=ADlog=EF=BC=8C=E5=87=BA?= =?UTF-8?q?=E4=BA=8E=E6=97=A5=E5=BF=97=E5=8F=AF=E8=AF=BB=E6=80=A7=E8=80=83?= =?UTF-8?q?=E8=99=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ src/plugins/chat/bot.py | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b7920bdc0..d17c6adc1 100644 --- a/.gitignore +++ b/.gitignore @@ -211,3 +211,5 @@ jieba.cache # If using PyEnv and configured to use a specific Python version locally # a .local-version file will be created in the root of the project to specify the version. .python-version + +OtherRes.txt \ No newline at end of file diff --git a/src/plugins/chat/bot.py b/src/plugins/chat/bot.py index 384031051..794e3ac22 100644 --- a/src/plugins/chat/bot.py +++ b/src/plugins/chat/bot.py @@ -210,12 +210,15 @@ class ChatBot: is_head=not mark_head, is_emoji=False, ) - logger.debug(f"bot_message: {bot_message}") if not mark_head: mark_head = True - logger.debug(f"添加消息到message_set: {bot_message}") message_set.add_message(bot_message) - + if len(str(bot_message)) < 1000: + logger.debug(f"bot_message: {bot_message}") + logger.debug(f"添加消息到message_set: {bot_message}") + else: + logger.debug(f"bot_message: {str(bot_message)[:1000]}...{str(bot_message)[-10:]}") + logger.debug(f"添加消息到message_set: {str(bot_message)[:1000]}...{str(bot_message)[-10:]}") # message_set 可以直接加入 message_manager # print(f"\033[1;32m[回复]\033[0m 将回复载入发送容器")