谢谢大家

1
This commit is contained in:
SengokuCola
2025-03-02 21:03:56 +08:00
parent 927ae4484f
commit 65d983f37f
2 changed files with 2 additions and 2 deletions

2
.env
View File

@@ -1,5 +1,5 @@
# 您不应该修改默认值,这个文件被仓库索引,请修改.env.prod
ENVIRONMENT=prod
ENVIRONMENT=dev
HOST=127.0.0.1
PORT=8080

2
bot.py
View File

@@ -29,7 +29,7 @@ env_file = f".env.{env}"
if env_file == ".env.dev" and os.path.exists(env_file):
logger.success("加载开发环境变量配置")
load_dotenv(env_file, override=True) # override=True 允许覆盖已存在的环境变量
elif env_file == ".env.prod" and os.path.exists(env_file):
elif os.path.exists(".env.prod"):
logger.success("加载环境变量配置")
load_dotenv(env_file, override=True) # override=True 允许覆盖已存在的环境变量
else: