mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 03:36:52 +08:00
📝 update adapter connection guide
This commit is contained in:
parent
0d5930fc3a
commit
064ed81758
@ -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`
|
||||
|
@ -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__":
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user