mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
✨ 更新 BOT 自我介绍帮助信息,增加文件不存在时自动创建功能
This commit is contained in:
parent
11081ef4ab
commit
e5ca27722a
@ -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(),
|
||||
)
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user