🎨 improve cqhttp

This commit is contained in:
yanyongyu
2020-12-03 16:04:14 +08:00
parent 4b764ccba3
commit dc691889e3
13 changed files with 529 additions and 290 deletions

View File

@ -1,21 +1,9 @@
from nonebot.typing import NoReturn
from nonebot.typing import Union, Optional
from nonebot.exception import RequestDenied
from nonebot.typing import Optional
from nonebot.utils import logger_wrapper
log = logger_wrapper("CQHTTP")
def get_auth_bearer(
access_token: Optional[str] = None) -> Union[Optional[str], NoReturn]:
if not access_token:
return None
scheme, _, param = access_token.partition(" ")
if scheme.lower() not in ["bearer", "token"]:
raise RequestDenied(401, "Not authenticated")
return param
def escape(s: str, *, escape_comma: bool = True) -> str:
"""
:说明: