fix: 修复容器重启后 bot_config.toml 会被覆盖的问题

This commit is contained in:
Rikki
2025-03-07 05:31:55 +08:00
parent c6cd38029f
commit dac57cf154
3 changed files with 2 additions and 2 deletions

4
bot.py
View File

@@ -17,11 +17,11 @@ print(rainbow_text)
'''彩蛋'''
# 初次启动检测
if not os.path.exists("config/bot_config.toml") or not os.path.exists(".env"):
if not os.path.exists("config/bot_config.toml"):
logger.info("检测到bot_config.toml不存在正在从模板复制")
import shutil
shutil.copy("config/bot_config_template.toml", "config/bot_config.toml")
shutil.copy("templete/bot_config_template.toml", "config/bot_config.toml")
logger.info("复制完成请修改config/bot_config.toml和.env.prod中的配置后重新启动")
# 初始化.env 默认ENVIRONMENT=prod