📝 update adapter connection guide

This commit is contained in:
yanyongyu 2020-12-02 15:14:24 +08:00
parent 0d5930fc3a
commit 064ed81758
3 changed files with 29 additions and 1 deletions

View File

@ -17,6 +17,22 @@ sidebarDepth: 0
FastAPI 驱动框架
* **上报地址**
* `/{adapter name}/`: HTTP POST 上报
* `/{adapter name}/http/`: HTTP POST 上报
* `/{adapter name}/ws`: WebSocket 上报
* `/{adapter name}/ws/`: WebSocket 上报
### _property_ `type`
驱动名称: `fastapi`

View File

@ -16,8 +16,11 @@ nb create
```python{3,4,7}
import nonebot
from nonebot.adapters.cqhttp import Bot as CQHTTPBot
nonebot.init()
driver = nonebot.get_driver()
driver.register_adapter("cqhttp", CQHTTPBot)
nonebot.load_builtin_plugins()
if __name__ == "__main__":

View File

@ -39,7 +39,16 @@ def get_auth_bearer(access_token: Optional[str] = Header(
class Driver(BaseDriver):
"""FastAPI 驱动框架"""
"""
FastAPI 驱动框架
:上报地址:
* ``/{adapter name}/``: HTTP POST 上报
* ``/{adapter name}/http/``: HTTP POST 上报
* ``/{adapter name}/ws``: WebSocket 上报
* ``/{adapter name}/ws/``: WebSocket 上报
"""
def __init__(self, env: Env, config: Config):
super().__init__(env, config)