mirror of
https://github.com/TriM-Organization/LiteyukiBot-TriM.git
synced 2024-11-11 01:27:29 +08:00
🐛 当没有 .env 文件时意外加载错误的环境变量
This commit is contained in:
parent
246e43317f
commit
4c65a308d6
@ -7,8 +7,9 @@ from .defines import *
|
|||||||
|
|
||||||
|
|
||||||
def auto_set_env(config: dict):
|
def auto_set_env(config: dict):
|
||||||
dotenv.load_dotenv()
|
dotenv.load_dotenv(".env")
|
||||||
if os.getenv("DRIVER", None) is not None:
|
if os.getenv("DRIVER", None) is not None:
|
||||||
|
print(os.getenv("DRIVER"))
|
||||||
nonebot.logger.info("Driver already set in environment variable, skip auto configure.")
|
nonebot.logger.info("Driver already set in environment variable, skip auto configure.")
|
||||||
return
|
return
|
||||||
if config.get("satori", {'enable': False}).get("enable", False):
|
if config.get("satori", {'enable': False}).get("enable", False):
|
||||||
|
Loading…
Reference in New Issue
Block a user