diff --git a/pyproject.toml b/pyproject.toml index 217dfac..26a56c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hikari-bot" -version = "1.0.5" +version = "1.0.6" description = "Nonebot2 HikariBot,支持战舰世界水表查询" authors = ["benx1n "] license = "MIT" diff --git a/src/plugins/hikari_bot/__init__.py b/src/plugins/hikari_bot/__init__.py index 84c5578..da3dd81 100644 --- a/src/plugins/hikari_bot/__init__.py +++ b/src/plugins/hikari_bot/__init__.py @@ -44,7 +44,7 @@ is_first_run = True _nlmt = DailyNumberLimiter(_max) _flmt = FreqLimiter(3) -__bot_version__ = '1.0.5' +__bot_version__ = '1.0.6' bot_get_random_pic = on_fullmatch('wws 随机表情包', block=True, priority=5) bot_update = on_fullmatch('wws 更新Hikari', priority=5, block=True, permission=SUPERUSER) diff --git a/src/plugins/hikari_bot/game/ocr.py b/src/plugins/hikari_bot/game/ocr.py index e6ccde4..7759e42 100644 --- a/src/plugins/hikari_bot/game/ocr.py +++ b/src/plugins/hikari_bot/game/ocr.py @@ -51,11 +51,11 @@ async def upload_OcrResult(result_text, filename): 'md5': filename, 'text': b64encode(result_text.encode('utf-8')).decode('utf-8'), } - async with httpx.AsyncClient(headers=headers, timeout=5) as client: - resp = await client.post(upload_url, json=params) - result = orjson.loads(resp.content) - if result['code'] == 200: - await downlod_OcrResult() + client = await get_client_yuyuko() + resp = await client.post(upload_url, json=params) + result = orjson.loads(resp.content) + if result['code'] == 200: + await downlod_OcrResult() except Exception: logger.error(traceback.format_exc())