mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-09-29 00:32:06 +08:00
update code
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from utils.user_agent import get_user_agent
|
||||
from configs.path_config import TXT_PATH
|
||||
from configs.config import NICKNAME
|
||||
from typing import List
|
||||
from pathlib import Path
|
||||
import ujson as json
|
||||
@@ -37,7 +38,7 @@ async def get_yiqing_data(area: str):
|
||||
province = p
|
||||
city = area
|
||||
if not province and not city:
|
||||
return "小真寻只支持国内的疫情查询喔..."
|
||||
return f"{NICKNAME}只支持国内的疫情查询喔..."
|
||||
async with aiohttp.ClientSession(headers=get_user_agent()) as session:
|
||||
async with session.get(url, timeout=7) as response:
|
||||
epidemic_data = json.loads((await response.json())["data"])
|
||||
|
||||
Reference in New Issue
Block a user