mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-09-21 05:12:34 +00:00
change coolq into cqhttp
This commit is contained in:
parent
10f1ab70b4
commit
41713f0645
@ -70,6 +70,8 @@ html_theme = 'alabaster'
|
|||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
html_static_path = ['_static']
|
||||||
|
|
||||||
|
# html_baseurl = '/api/'
|
||||||
|
|
||||||
# -- Extension configuration -------------------------------------------------
|
# -- Extension configuration -------------------------------------------------
|
||||||
|
|
||||||
# -- Options for todo extension ----------------------------------------------
|
# -- Options for todo extension ----------------------------------------------
|
||||||
|
@ -14,7 +14,7 @@ from fastapi import Body, FastAPI, WebSocket as FastAPIWebSocket
|
|||||||
from nonebot.log import logger
|
from nonebot.log import logger
|
||||||
from nonebot.config import Config
|
from nonebot.config import Config
|
||||||
from nonebot.drivers import BaseDriver, BaseWebSocket
|
from nonebot.drivers import BaseDriver, BaseWebSocket
|
||||||
from nonebot.adapters.coolq import Bot as CoolQBot
|
from nonebot.adapters.cqhttp import Bot as CQBot
|
||||||
|
|
||||||
|
|
||||||
class Driver(BaseDriver):
|
class Driver(BaseDriver):
|
||||||
@ -94,8 +94,8 @@ class Driver(BaseDriver):
|
|||||||
"/", auto_error=False)):
|
"/", auto_error=False)):
|
||||||
# TODO: Check authorization
|
# TODO: Check authorization
|
||||||
logger.debug(f"Received message: {data}")
|
logger.debug(f"Received message: {data}")
|
||||||
if adapter == "coolq":
|
if adapter == "cqhttp":
|
||||||
bot = CoolQBot("http", self.config)
|
bot = CQBot("http", self.config)
|
||||||
await bot.handle_message(data)
|
await bot.handle_message(data)
|
||||||
return {"status": 200, "message": "success"}
|
return {"status": 200, "message": "success"}
|
||||||
|
|
||||||
@ -116,8 +116,8 @@ class Driver(BaseDriver):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
logger.debug(f"Received message: {data}")
|
logger.debug(f"Received message: {data}")
|
||||||
if adapter == "coolq":
|
if adapter == "cqhttp":
|
||||||
bot = CoolQBot("websocket", self.config, websocket=websocket)
|
bot = CQBot("websocket", self.config, websocket=websocket)
|
||||||
await bot.handle_message(data)
|
await bot.handle_message(data)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user