🐛 fix cqhttp secret checking #289

This commit is contained in:
yanyongyu
2021-03-20 14:49:58 +08:00
parent 22033e1cfb
commit 2166595e50
11 changed files with 61 additions and 54 deletions

View File

@ -178,7 +178,7 @@ class Bot(BaseBot):
@classmethod
@overrides(BaseBot)
async def check_permission(cls, driver: "Driver", connection_type: str,
headers: dict, body: Optional[dict]) -> str:
headers: dict, body: Optional[bytes]) -> str:
if connection_type == 'ws':
raise RequestDenied(
status_code=501,
@ -224,7 +224,7 @@ class Bot(BaseBot):
\:\:\: danger
由于Mirai的HTTP API特殊性, 该API暂时无法实现
\:\:\:
\:\:\: tip
你可以使用 ``MiraiBot.api`` 中提供的调用方法来代替
\:\:\:
@ -447,7 +447,7 @@ class Bot(BaseBot):
:说明:
使用此方法获取bot接收到的最老消息和最老各类事件
(不会从MiraiApiHttp消息记录中删除)
(不会从MiraiApiHttp消息记录中删除)
:参数:
@ -462,7 +462,7 @@ class Bot(BaseBot):
使用此方法获取bot接收到的最新消息和最新各类事件
(不会从MiraiApiHttp消息记录中删除)
:参数:
* ``count: int``: 获取消息和事件的数量
@ -599,7 +599,7 @@ class Bot(BaseBot):
"""
:说明:
使用此方法使Bot退出群聊
使用此方法使Bot退出群聊
:参数:

View File

@ -116,7 +116,8 @@ class WebsocketBot(Bot):
@classmethod
@overrides(Bot)
async def check_permission(cls, driver: "Driver", connection_type: str,
headers: dict, body: Optional[dict]) -> NoReturn:
headers: dict,
body: Optional[bytes]) -> NoReturn:
raise RequestDenied(
status_code=501,
reason=f'Connection {connection_type} not implented')
@ -127,7 +128,7 @@ class WebsocketBot(Bot):
"""
:说明:
注册该Adapter
注册该Adapter
:参数: