add auth check and config docs

This commit is contained in:
yanyongyu
2020-08-20 16:34:07 +08:00
parent 02ca49f6d0
commit 26c697f5e4
5 changed files with 274 additions and 25 deletions

View File

@ -67,7 +67,7 @@ class ResultStore:
future.set_result(result)
@classmethod
async def fetch(cls, seq: int, timeout: float) -> Dict[str, Any]:
async def fetch(cls, seq: int, timeout: Optional[float]) -> Dict[str, Any]:
future = asyncio.get_event_loop().create_future()
cls._futures[seq] = future
try:
@ -137,7 +137,7 @@ class Bot(BaseBot):
api_root += "/"
headers = {}
if self.config.access_token:
if self.config.access_token is not None:
headers["Authorization"] = "Bearer " + self.config.access_token
try: