Skip to content

Commit

Permalink
news60s 修复报错
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao authored Jan 8, 2024
1 parent d286db0 commit 01f1e28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions news60s/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def get_news60s() -> None:
return
resp = await client.get("https://api.03c3.cn/api/zb?type=jsonImg")
res = resp.json()
assert res["msg"] == "success", f"API 返回错误: {res['code']} ({res['msg']})"
assert res["msg"] == "ok", f"API 返回错误: {res['code']} ({res['msg']})"
news_date = datetime.strptime(res["data"]["datetime"], "%Y-%m-%d").date()
if news_date == news60s_cache_date and not force_update:
return
Expand Down Expand Up @@ -61,7 +61,7 @@ async def news60s(message: Message):
if not message.arguments:
try:
await get_news60s()
except ValueError as e:
except (ValueError, AssertionError) as e:
return await message.edit(e.__str__())
await message.safe_delete()
await push_news60s(message.chat.id)
Expand Down

0 comments on commit 01f1e28

Please sign in to comment.