mirror of https://github.com/avilliai/Manyana.git
Update weatherQuery.py
This commit is contained in:
parent
428f66ff64
commit
4b59446556
|
@ -34,6 +34,11 @@ async def querys(city, API_KEY) -> str:
|
|||
f'气温{data["results"][0]["now"]["temperature"]}℃。'
|
||||
except (httpx.NetworkError, httpx.HTTPStatusError, KeyError):
|
||||
return f'抱歉,没有找到{city}的天气数据。'
|
||||
async def fullQuery(city):
|
||||
async with httpx.AsyncClient() as client:
|
||||
r=await client.get(f"https://api.lolimi.cn/API/weather/?city={city}")
|
||||
data=r.json()
|
||||
return data["data"]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue