From d9b0fb6d55aa672e30f975f21ef2a911e9eec811 Mon Sep 17 00:00:00 2001 From: HibiKier <775757368@qq.com> Date: Wed, 16 Jul 2025 02:43:16 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E5=9C=A8=20BotProfileManager=20?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=E8=87=AA=E6=88=91=E4=BB=8B=E7=BB=8D?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=AE=B0=E5=BD=95=EF=BC=8C=E4=BC=98=E5=8C=96=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=AF=BB=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhenxun/utils/manager/bot_profile_manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zhenxun/utils/manager/bot_profile_manager.py b/zhenxun/utils/manager/bot_profile_manager.py index bdd4cad6..5e1d1237 100644 --- a/zhenxun/utils/manager/bot_profile_manager.py +++ b/zhenxun/utils/manager/bot_profile_manager.py @@ -14,6 +14,7 @@ from zhenxun.configs.path_config import DATA_PATH, TEMPLATE_PATH from zhenxun.configs.utils.models import PluginExtraData from zhenxun.models.statistics import Statistics from zhenxun.models.user_console import UserConsole +from zhenxun.services.log import logger from zhenxun.utils._build_image import BuildImage from zhenxun.utils.platform import PlatformUtils @@ -89,6 +90,9 @@ class BotProfileManager: bot_file_path = PROFILE_PATH / f"{bot_id}" bot_file_path.mkdir(parents=True, exist_ok=True) bot_profile_file = bot_file_path / "profile.txt" + if not bot_profile_file.exists(): + logger.debug(f"BOT自我介绍文件不存在: {bot_profile_file}, 跳过读取") + return async with aiofiles.open(bot_profile_file, encoding="utf-8") as f: introduction = await f.read() avatar = bot_file_path / f"{bot_id}.png"