修复所有type hint(当时写的时候mypy炸了

使用神秘新架构
独立request模块
版本推进
fixed #1 [BUG] 茶服无法查询用户名内带有大写字母的用户
This commit is contained in:
2022-07-24 15:15:39 +08:00
parent 0d2b37e78a
commit f1291a9923
12 changed files with 393 additions and 392 deletions

View File

@@ -0,0 +1,17 @@
from nonebot.log import logger
from typing import Any
import aiohttp
async def request(Url: str) -> tuple[bool, bool, dict[str, Any]]:
# 封装请求函数
try:
async with aiohttp.ClientSession() as session:
async with session.get(Url) as resp:
data = await resp.json()
return (True, data['success'], data)
except aiohttp.client_exceptions.ClientConnectorError as e:
logger.error(f'[TETRIS STATS] request.request: 请求错误\n{e}')
return (False, False, {})