Skip to content

Commit

Permalink
[#]在修一下上报ocr, bump version 1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
benx1n committed Dec 6, 2023
1 parent 8e3da6d commit 8917063
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hikari-bot"
version = "1.0.5"
version = "1.0.6"
description = "Nonebot2 HikariBot,支持战舰世界水表查询"
authors = ["benx1n <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/hikari_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/hikari_bot/game/ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit 8917063

Please sign in to comment.