mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-11 16:26:02 +00:00
feat: 基本插件加载功能
This commit is contained in:
@@ -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']
|
||||
|
||||
@@ -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
|
||||
|
||||
# 执行启动流程
|
||||
|
||||
Reference in New Issue
Block a user