noneflow[bot] 033c90dd74
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 2s
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Waiting to run
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 6m59s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 7m7s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 5m14s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 5m42s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 4m51s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 7m12s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 6m33s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 8m12s
Ruff Lint / Ruff Lint (push) Successful in 43s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 6m56s
Site Deploy / publish (push) Failing after 7m21s
🔖 Release 2.4.1
2024-12-25 07:21:05 +00:00

3.5 KiB
Raw Blame History

mdx sidebar_position description
format
md
5 nonebot.drivers.quart 模块

nonebot.drivers.quart

Quart 驱动适配

nb driver install quart
# 或者
pip install nonebot2[quart]

:::tip 提示 本驱动仅支持服务端连接 :::

class Config(<auto>)

  • 说明: Quart 驱动框架设置

  • 参数

    auto

class-var quart_reload

  • 类型: bool

  • 说明: 开启/关闭冷重载

class-var quart_reload_dirs

  • 类型: list[str] | None

  • 说明: 重载监控文件夹列表,默认为 uvicorn 默认值

class-var quart_reload_delay

  • 类型: float

  • 说明: 重载延迟,默认为 uvicorn 默认值

class-var quart_reload_includes

  • 类型: list[str] | None

  • 说明: 要监听的文件列表,支持 glob pattern默认为 uvicorn 默认值

class-var quart_reload_excludes

  • 类型: list[str] | None

  • 说明: 不要监听的文件列表,支持 glob pattern默认为 uvicorn 默认值

class-var quart_extra

  • 类型: dict[str, Any]

  • 说明: 传递给 Quart 的其他参数。

class Driver(env, config)

  • 说明: Quart 驱动框架

  • 参数

    • env (Env)

    • config (NoneBotConfig)

property type

  • 类型: str

  • 说明: 驱动名称: quart

property server_app

  • 类型: Quart

  • 说明: Quart 对象

property asgi

  • 类型: untyped

  • 说明: Quart 对象

property logger

  • 类型: untyped

  • 说明: Quart 使用的 logger

method setup_http_server(setup)

method setup_websocket_server(setup)

method run(host=None, port=None, *args, app=None, **kwargs)

  • 说明: 使用 uvicorn 启动 Quart

  • 参数

    • host (str | None)

    • port (int | None)

    • *args

    • app (str | None)

    • **kwargs

  • 返回

    • untyped

class WebSocket(*, request, websocket_ctx)

  • 说明: Quart WebSocket Wrapper

  • 参数

    • request (BaseRequest)

    • websocket_ctx (WebsocketContext)

async method accept()

  • 参数

    empty

  • 返回

    • untyped

async method close(code=1000, reason="")

  • 参数

    • code (int)

    • reason (str)

  • 返回

    • untyped

async method receive()

  • 参数

    empty

  • 返回

    • str | bytes

async method receive_text()

  • 参数

    empty

  • 返回

    • str

async method receive_bytes()

  • 参数

    empty

  • 返回

    • bytes

async method send_text(data)

  • 参数

    • data (str)
  • 返回

    • untyped

async method send_bytes(data)

  • 参数

    • data (bytes)
  • 返回

    • untyped