mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-07 04:26:45 +00:00
删除类型
This commit is contained in:
@ -41,18 +41,15 @@ class Driver(abc.ABC):
|
||||
|
||||
_adapters: Dict[str, "Adapter"] = {}
|
||||
"""
|
||||
:类型: ``Dict[str, Adapter]``
|
||||
:说明: 已注册的适配器列表
|
||||
:说明: 已注册的适配器列表
|
||||
"""
|
||||
_bot_connection_hook: Set[T_BotConnectionHook] = set()
|
||||
"""
|
||||
:类型: ``Set[T_BotConnectionHook]``
|
||||
:说明: Bot 连接建立时执行的函数
|
||||
:说明: Bot 连接建立时执行的函数
|
||||
"""
|
||||
_bot_disconnection_hook: Set[T_BotDisconnectionHook] = set()
|
||||
"""
|
||||
:类型: ``Set[T_BotDisconnectionHook]``
|
||||
:说明: Bot 连接断开时执行的函数
|
||||
:说明: Bot 连接断开时执行的函数
|
||||
"""
|
||||
|
||||
def __init__(self, env: Env, config: Config):
|
||||
@ -64,26 +61,20 @@ class Driver(abc.ABC):
|
||||
"""
|
||||
self.env: str = env.environment
|
||||
"""
|
||||
:类型: ``str``
|
||||
:说明: 环境名称
|
||||
:说明: 环境名称
|
||||
"""
|
||||
self.config: Config = config
|
||||
"""
|
||||
:类型: ``Config``
|
||||
:说明: 配置对象
|
||||
:说明: 配置对象
|
||||
"""
|
||||
self._clients: Dict[str, "Bot"] = {}
|
||||
"""
|
||||
:类型: ``Dict[str, Bot]``
|
||||
:说明: 已连接的 Bot
|
||||
:说明: 已连接的 Bot
|
||||
"""
|
||||
|
||||
@property
|
||||
def bots(self) -> Dict[str, "Bot"]:
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``Dict[str, Bot]``
|
||||
:说明:
|
||||
|
||||
获取当前所有已连接的 Bot
|
||||
|
@ -168,7 +168,6 @@ class WebSocket(abc.ABC):
|
||||
@abc.abstractmethod
|
||||
def closed(self) -> bool:
|
||||
"""
|
||||
:类型: ``bool``
|
||||
:说明: 连接是否已经关闭
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
@ -48,90 +48,54 @@ class Config(BaseSettings):
|
||||
|
||||
fastapi_openapi_url: Optional[str] = None
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``Optional[str]``
|
||||
|
||||
:说明:
|
||||
|
||||
``openapi.json`` 地址,默认为 ``None`` 即关闭
|
||||
"""
|
||||
fastapi_docs_url: Optional[str] = None
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``Optional[str]``
|
||||
|
||||
:说明:
|
||||
|
||||
``swagger`` 地址,默认为 ``None`` 即关闭
|
||||
"""
|
||||
fastapi_redoc_url: Optional[str] = None
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``Optional[str]``
|
||||
|
||||
:说明:
|
||||
|
||||
``redoc`` 地址,默认为 ``None`` 即关闭
|
||||
"""
|
||||
fastapi_include_adapter_schema: bool = True
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``bool``
|
||||
|
||||
:说明:
|
||||
|
||||
是否包含适配器路由的 schema,默认为 ``True``
|
||||
"""
|
||||
fastapi_reload: bool = False
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``bool``
|
||||
|
||||
:说明:
|
||||
|
||||
开启/关闭冷重载
|
||||
"""
|
||||
fastapi_reload_dirs: Optional[List[str]] = None
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``Optional[List[str]]``
|
||||
|
||||
:说明:
|
||||
|
||||
重载监控文件夹列表,默认为 uvicorn 默认值
|
||||
"""
|
||||
fastapi_reload_delay: Optional[float] = None
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``Optional[float]``
|
||||
|
||||
:说明:
|
||||
|
||||
重载延迟,默认为 uvicorn 默认值
|
||||
"""
|
||||
fastapi_reload_includes: Optional[List[str]] = None
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``Optional[List[str]]``
|
||||
|
||||
:说明:
|
||||
|
||||
要监听的文件列表,支持 glob pattern,默认为 uvicorn 默认值
|
||||
"""
|
||||
fastapi_reload_excludes: Optional[List[str]] = None
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``Optional[List[str]]``
|
||||
|
||||
:说明:
|
||||
|
||||
不要监听的文件列表,支持 glob pattern,默认为 uvicorn 默认值
|
||||
|
@ -56,50 +56,30 @@ class Config(BaseSettings):
|
||||
|
||||
quart_reload: bool = False
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``bool``
|
||||
|
||||
:说明:
|
||||
|
||||
开启/关闭冷重载
|
||||
"""
|
||||
quart_reload_dirs: Optional[List[str]] = None
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``Optional[List[str]]``
|
||||
|
||||
:说明:
|
||||
|
||||
重载监控文件夹列表,默认为 uvicorn 默认值
|
||||
"""
|
||||
quart_reload_delay: Optional[float] = None
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``Optional[float]``
|
||||
|
||||
:说明:
|
||||
|
||||
重载延迟,默认为 uvicorn 默认值
|
||||
"""
|
||||
quart_reload_includes: Optional[List[str]] = None
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``Optional[List[str]]``
|
||||
|
||||
:说明:
|
||||
|
||||
要监听的文件列表,支持 glob pattern,默认为 uvicorn 默认值
|
||||
"""
|
||||
quart_reload_excludes: Optional[List[str]] = None
|
||||
"""
|
||||
:类型:
|
||||
|
||||
``Optional[List[str]]``
|
||||
|
||||
:说明:
|
||||
|
||||
不要监听的文件列表,支持 glob pattern,默认为 uvicorn 默认值
|
||||
|
Reference in New Issue
Block a user