更新 BOT 自我介绍帮助信息,增加文件不存在时自动创建功能

This commit is contained in:
HibiKier 2025-07-16 02:46:53 +08:00
parent 11081ef4ab
commit e5ca27722a
2 changed files with 7 additions and 1 deletions

View File

@ -21,7 +21,12 @@ __plugin_meta__ = PluginMetadata(
author="HibiKier",
version="0.1",
menu_type="其他",
superuser_help="重载自我介绍",
superuser_help="""
在data/bot_profile/bot_id/profile.txt 中编辑BOT自我介绍
在data/bot_profile/bot_id/bot_id.png 中编辑BOT头像
指令
重载自我介绍
""".strip(),
).to_dict(),
)

View File

@ -92,6 +92,7 @@ class BotProfileManager:
bot_profile_file = bot_file_path / "profile.txt"
if not bot_profile_file.exists():
logger.debug(f"BOT自我介绍文件不存在: {bot_profile_file}, 跳过读取")
bot_file_path.touch()
return
async with aiofiles.open(bot_profile_file, encoding="utf-8") as f:
introduction = await f.read()