mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-14 13:47:24 +08:00
🐛 bug: 修复状态卡片显示问题
This commit is contained in:
parent
8e3d3b3b5d
commit
596f4d06ea
@ -1,7 +1,6 @@
|
|||||||
import aiohttp
|
import aiohttp
|
||||||
|
|
||||||
from .qw_models import *
|
from .qw_models import *
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...utils.base.data_manager import get_memory_data
|
from ...utils.base.data_manager import get_memory_data
|
||||||
from ...utils.base.language import Language
|
from ...utils.base.language import Language
|
||||||
@ -94,7 +93,7 @@ async def city_lookup(
|
|||||||
"key" : key,
|
"key" : key,
|
||||||
"lang" : lang,
|
"lang" : lang,
|
||||||
}
|
}
|
||||||
async with httpx.AsyncClient() as client:
|
async with aiohttp.ClientSession() as client:
|
||||||
resp = await client.get(url, params=params)
|
resp = await client.get(url, params=params)
|
||||||
return CityLookup.parse_obj(resp.json())
|
return CityLookup.parse_obj(resp.json())
|
||||||
|
|
||||||
@ -114,9 +113,9 @@ async def get_weather_now(
|
|||||||
"lang" : lang,
|
"lang" : lang,
|
||||||
"unit" : unit,
|
"unit" : unit,
|
||||||
}
|
}
|
||||||
async with httpx.AsyncClient() as client:
|
async with aiohttp.ClientSession() as client:
|
||||||
resp = await client.get(url, params=params)
|
resp = await client.get(url, params=params)
|
||||||
return resp.json()
|
return await resp.json()
|
||||||
|
|
||||||
|
|
||||||
async def get_weather_daily(
|
async def get_weather_daily(
|
||||||
@ -134,9 +133,9 @@ async def get_weather_daily(
|
|||||||
"lang" : lang,
|
"lang" : lang,
|
||||||
"unit" : unit,
|
"unit" : unit,
|
||||||
}
|
}
|
||||||
async with httpx.AsyncClient() as client:
|
async with aiohttp.ClientSession() as client:
|
||||||
resp = await client.get(url, params=params)
|
resp = await client.get(url, params=params)
|
||||||
return resp.json()
|
return await resp.json()
|
||||||
|
|
||||||
|
|
||||||
async def get_weather_hourly(
|
async def get_weather_hourly(
|
||||||
@ -154,9 +153,9 @@ async def get_weather_hourly(
|
|||||||
"lang" : lang,
|
"lang" : lang,
|
||||||
"unit" : unit,
|
"unit" : unit,
|
||||||
}
|
}
|
||||||
async with httpx.AsyncClient() as client:
|
async with aiohttp.ClientSession() as client:
|
||||||
resp = await client.get(url, params=params)
|
resp = await client.get(url, params=params)
|
||||||
return resp.json()
|
return await resp.json()
|
||||||
|
|
||||||
|
|
||||||
async def get_airquality(
|
async def get_airquality(
|
||||||
@ -175,9 +174,9 @@ async def get_airquality(
|
|||||||
"pollutant": pollutant,
|
"pollutant": pollutant,
|
||||||
"station" : station,
|
"station" : station,
|
||||||
}
|
}
|
||||||
async with httpx.AsyncClient() as client:
|
async with aiohttp.ClientSession() as client:
|
||||||
resp = await client.get(url, params=params)
|
resp = await client.get(url, params=params)
|
||||||
return resp.json()
|
return await resp.json()
|
||||||
|
|
||||||
async def get_astronomy(
|
async def get_astronomy(
|
||||||
key: str,
|
key: str,
|
||||||
@ -192,6 +191,6 @@ async def get_astronomy(
|
|||||||
"location" : location,
|
"location" : location,
|
||||||
"date" : date,
|
"date" : date,
|
||||||
}
|
}
|
||||||
async with httpx.AsyncClient() as client:
|
async with aiohttp.ClientSession() as client:
|
||||||
resp = await client.get(url, params=params)
|
resp = await client.get(url, params=params)
|
||||||
return resp.json()
|
return await resp.json()
|
@ -121,9 +121,10 @@
|
|||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
white-space: nowrap;
|
white-space: normal; /* 允许换行 */
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
word-break: break-all; /* 允许在单词内换行 */
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user