diff --git a/nonebot/__init__.py b/nonebot/__init__.py index 1611e714..0049bf76 100644 --- a/nonebot/__init__.py +++ b/nonebot/__init__.py @@ -10,11 +10,6 @@ from nonebot.config import Env, Config from nonebot.adapters.cqhttp import Bot as CQBot from nonebot.typing import Type, Union, Driver, Optional, NoReturn -try: - import nonebot_test -except ImportError: - nonebot_test = None - _driver: Optional[Driver] = None @@ -34,6 +29,17 @@ def get_asgi(): return driver.asgi +def get_bots(): + driver = get_driver() + return driver.bots + + +try: + import nonebot_test +except ImportError: + nonebot_test = None + + def init(*, _env_file: Optional[str] = None, **kwargs): global _driver env = Env()