fix nonebot-test

This commit is contained in:
yanyongyu 2020-08-15 17:47:50 +08:00
parent c4a5cfb513
commit 865fd6af4c

View File

@ -10,11 +10,6 @@ from nonebot.config import Env, Config
from nonebot.adapters.cqhttp import Bot as CQBot from nonebot.adapters.cqhttp import Bot as CQBot
from nonebot.typing import Type, Union, Driver, Optional, NoReturn from nonebot.typing import Type, Union, Driver, Optional, NoReturn
try:
import nonebot_test
except ImportError:
nonebot_test = None
_driver: Optional[Driver] = None _driver: Optional[Driver] = None
@ -34,6 +29,17 @@ def get_asgi():
return driver.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): def init(*, _env_file: Optional[str] = None, **kwargs):
global _driver global _driver
env = Env() env = Env()