fix: 数据库支持
This commit is contained in:
@ -1,12 +1,10 @@
|
||||
import nonebot
|
||||
from nonebot.plugin import PluginMetadata
|
||||
from liteyuki.utils.language import get_default_lang
|
||||
|
||||
from liteyuki.utils.data_manager import *
|
||||
from liteyuki.utils.language import get_default_lang
|
||||
from .core import *
|
||||
from .loader import *
|
||||
from .webdash import *
|
||||
from .core import *
|
||||
from liteyuki.utils.config import config
|
||||
from liteyuki.utils.liteyuki_api import liteyuki_api
|
||||
|
||||
__author__ = "snowykami"
|
||||
__plugin_meta__ = PluginMetadata(
|
||||
@ -20,8 +18,6 @@ __plugin_meta__ = PluginMetadata(
|
||||
}
|
||||
)
|
||||
|
||||
auto_migrate() # 自动迁移数据库
|
||||
|
||||
sys_lang = get_default_lang()
|
||||
nonebot.logger.info(sys_lang.get("main.current_language", LANG=sys_lang.get("language.name")))
|
||||
nonebot.logger.info(sys_lang.get("main.enable_webdash", URL=f"http://127.0.0.1:{config.get('port', 20216)}"))
|
||||
|
@ -16,11 +16,10 @@ nonebot.plugin.load_plugins("plugins")
|
||||
|
||||
init_log()
|
||||
|
||||
installed_plugins = plugin_db.all(InstalledPlugin)
|
||||
installed_plugins: list[InstalledPlugin] = plugin_db.all(InstalledPlugin())
|
||||
if installed_plugins:
|
||||
for installed_plugin in plugin_db.all(InstalledPlugin):
|
||||
if not check_for_package(installed_plugin.module_name):
|
||||
for installed_plugin in installed_plugins:
|
||||
if not installed_plugin.liteyuki and not check_for_package(installed_plugin.module_name):
|
||||
nonebot.logger.error(f"{installed_plugin.module_name} not installed, but in loading database. please run `npm fixup` in chat to reinstall it.")
|
||||
else:
|
||||
print(installed_plugin.module_name)
|
||||
nonebot.load_plugin(installed_plugin.module_name)
|
||||
|
Reference in New Issue
Block a user