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

This commit is contained in:
DrSmoothl
2025-03-15 12:24:38 +08:00
parent 5bf65522a7
commit dac1a6f769

View File

@@ -10,7 +10,11 @@ import json
is_share = False is_share = False
debug = True debug = True
try:
config_data = toml.load("config/bot_config.toml") 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"] CONFIG_VERSION = config_data["inner"]["version"]
PARSED_CONFIG_VERSION = float(CONFIG_VERSION[2:]) PARSED_CONFIG_VERSION = float(CONFIG_VERSION[2:])