MCPcopy
hub / github.com/nonebot/nonebot2 / load_all_plugins

Function load_all_plugins

nonebot/plugin/load.py:57–68  ·  view source on GitHub ↗

导入指定列表中的插件以及指定目录下多个插件,以 `_` 开头的插件不会被导入! 参数: module_path: 指定插件集合 plugin_dir: 指定文件夹路径集合

(
    module_path: Iterable[str], plugin_dir: Iterable[str]
)

Source from the content-addressed store, hash-verified

55
56
57def load_all_plugins(
58 module_path: Iterable[str], plugin_dir: Iterable[str]
59) -> set[Plugin]:
60 """导入指定列表中的插件以及指定目录下多个插件,以 `_` 开头的插件不会被导入!
61
62 参数:
63 module_path: 指定插件集合
64 plugin_dir: 指定文件夹路径集合
65 """
66 manager = PluginManager(module_path, plugin_dir)
67 _managers.append(manager)
68 return manager.load_all_plugins()
69
70
71def load_from_json(file_path: str, encoding: str = "utf-8") -> set[Plugin]:

Callers 3

load_from_jsonFunction · 0.85
load_from_tomlFunction · 0.85
load_builtin_pluginsFunction · 0.85

Calls 3

load_all_pluginsMethod · 0.95
PluginManagerClass · 0.85
appendMethod · 0.80

Tested by

no test coverage detected