mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-15 01:00:00 +08:00
Update data_source.py
This commit is contained in:
@@ -25,17 +25,17 @@ async def get_yiqing_data(area: str):
|
|||||||
if area == '中国':
|
if area == '中国':
|
||||||
province = area
|
province = area
|
||||||
province_type = ""
|
province_type = ""
|
||||||
elif area[-1] == '市' and area not in data.keys():
|
elif area in data.keys() and area[-1] != '市':
|
||||||
|
province = area if area[-1] != '省' else area[:-1]
|
||||||
|
if len(data[province]) == 1:
|
||||||
|
province_type = "市"
|
||||||
|
city = ""
|
||||||
|
else:
|
||||||
area = area[:-1] if area[-1] == '市' else area
|
area = area[:-1] if area[-1] == '市' else area
|
||||||
for p in data.keys():
|
for p in data.keys():
|
||||||
if area in data[p]:
|
if area in data[p]:
|
||||||
province = p
|
province = p
|
||||||
city = area
|
city = area
|
||||||
elif area in data.keys():
|
|
||||||
province = area if area[-1] != '省' else area[:-1]
|
|
||||||
if len(data[province]) == 1:
|
|
||||||
province_type = "市"
|
|
||||||
city = ""
|
|
||||||
if not province and not city:
|
if not province and not city:
|
||||||
return "小真寻只支持国内的疫情查询喔..."
|
return "小真寻只支持国内的疫情查询喔..."
|
||||||
async with aiohttp.ClientSession(headers=get_user_agent()) as session:
|
async with aiohttp.ClientSession(headers=get_user_agent()) as session:
|
||||||
|
|||||||
Reference in New Issue
Block a user