✨ 增强权限检查,更新请求管理命令和数据库配置逻辑

This commit is contained in:
HibiKier
2025-08-05 23:26:03 +08:00
parent 5c96761fd0
commit 4b0f905ced
5 changed files with 34 additions and 28 deletions
+3 -1
View File
@@ -46,6 +46,8 @@ driver = nonebot.get_driver()
def get_config() -> dict:
"""获取数据库配置"""
if not BotConfig.db_url:
raise DbUrlIsNode("数据库Url连接字符串为空,请检查配置文件(.env.dev)")
parsed = urlparse(BotConfig.db_url)
# 基础配置
@@ -92,7 +94,7 @@ def get_config() -> dict:
config["connections"]["default"] = {
"engine": "tortoise.backends.sqlite",
"credentials": {
"file_path": parsed.path or ":memory:",
"file_path": parsed.path,
},
**SQLITE_CONFIG,
}