feat: 基本插件加载功能

This commit is contained in:
Rock Chin
2023-01-13 16:49:56 +08:00
parent 9962a6ebcc
commit 78c1ad16ce
7 changed files with 208 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ context = {
},
'logger_handler': None,
'config': None,
'plugin_host': None,
}
@@ -38,4 +39,12 @@ def set_qqbot_manager(inst):
def get_qqbot_manager():
return context['inst']['qqbot.manager.QQBotManager']
return context['inst']['qqbot.manager.QQBotManager']
def set_plugin_host(inst):
context['plugin_host'] = inst
def get_plugin_host():
return context['plugin_host']

View File

@@ -32,6 +32,7 @@ def reload_all(notify=True):
importlib.reload(__import__('config'))
importlib.reload(__import__('main'))
importlib.reload(__import__('banlist'))
importlib.reload(__import__('plugins'))
pkg.utils.context.context = context
# 执行启动流程