We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nonebot-plugin-datastore/nonebot_plugin_datastore/config.py
Line 17 in 5857ae5
The text was updated successfully, but these errors were encountered:
惊,原来还有这种坑。nb的文档是不是也该改改
Sorry, something went wrong.
我去问了一下,就是这样设计的。必须要先在 .env 文件中配置所需配置项,nonebot 才会在环境变量中读取。
CUSTOM_CONFIG2= # 留空则从系统环境变量读取,如不存在则为空字符串
文档里确实没有说清楚。
No branches or pull requests
nonebot-plugin-datastore/nonebot_plugin_datastore/config.py
Line 17 in 5857ae5
这个地方应该继承BaseSettings
因为nonebot的global_config对环境变量和envfile的处理有差异,写在envfile里的文件会全部load进global_config,插件config从global_config中初始化会带上global_config load的envfile里的值
但是,global_config不会load自己不认识的环境变量,所以如果这里使用BaseModel的话,是没有办法将环境变量的值引入插件config的,需要使用BaseSetting来自己读取环境变量中的值
The text was updated successfully, but these errors were encountered: