尝试调整一下内容
This commit is contained in:
@@ -108,9 +108,11 @@ class PluginManager:
|
|||||||
for name, obj in inspect.getmembers(module):
|
for name, obj in inspect.getmembers(module):
|
||||||
if (inspect.isclass(obj) and
|
if (inspect.isclass(obj) and
|
||||||
issubclass(obj, PluginInterface) and
|
issubclass(obj, PluginInterface) and
|
||||||
obj != PluginInterface and
|
obj != PluginInterface
|
||||||
obj != MessagePluginInterface and
|
# 修改这里:不排除继承自 MessagePluginInterface 和 ScheduledPluginInterface 的类
|
||||||
obj != ScheduledPluginInterface):
|
# obj != MessagePluginInterface and
|
||||||
|
# obj != ScheduledPluginInterface
|
||||||
|
):
|
||||||
plugin_class = obj
|
plugin_class = obj
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
# 插件初始化文件
|
from plugins.message_summary.main import MessageSummaryPlugin
|
||||||
# 从main模块导入插件类
|
|
||||||
from .main import MessageSummaryPlugin
|
def get_plugin():
|
||||||
|
"""获取插件实例"""
|
||||||
|
return MessageSummaryPlugin()
|
||||||
|
|
||||||
|
__all__ = ['MessageSummaryPlugin', 'get_plugin']
|
||||||
Reference in New Issue
Block a user