更新检查配置文件是否存在功能

pull/406/head
DrSmoothl 2025-03-15 12:24:38 +08:00
parent 5bf65522a7
commit dac1a6f769
1 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,11 @@ import json
is_share = False
debug = True
config_data = toml.load("config/bot_config.toml")
try:
config_data = toml.load("config/bot_config.toml")
except Exception as e:
logger.error(f"读取配置文件失败,请检查配置文件是否存在,错误信息为:{e}")
sys.exit(1)
CONFIG_VERSION = config_data["inner"]["version"]
PARSED_CONFIG_VERSION = float(CONFIG_VERSION[2:])