fix: 修复容器重启后 bot_config.toml 会被覆盖的问题
This commit is contained in:
4
bot.py
4
bot.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user