mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
🐛 fix parent detect error after require (#1121)
This commit is contained in:
@ -1,6 +1,13 @@
|
||||
from pathlib import Path
|
||||
|
||||
import nonebot
|
||||
from nonebot.plugin import PluginManager, _managers
|
||||
|
||||
_sub_plugins = set()
|
||||
_sub_plugins |= nonebot.load_plugins(str((Path(__file__).parent / "plugins").resolve()))
|
||||
manager = PluginManager(
|
||||
search_path=[str((Path(__file__).parent / "plugins").resolve())]
|
||||
)
|
||||
_managers.append(manager)
|
||||
|
||||
# test load nested plugin with require
|
||||
manager.load_plugin("nested_subplugin")
|
||||
manager.load_plugin("nested_subplugin2")
|
||||
|
Reference in New Issue
Block a user