covid fix a bug

This commit is contained in:
xtaodada 2022-01-16 13:42:21 +08:00
parent d17e7c8662
commit 624c16b0db
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 9 additions and 3 deletions

View File

@ -126,8 +126,14 @@ async def covid_info(context):
city = await obtain_message(context)
except ValueError:
return await context.edit("[covid] 无法获取城市名!")
zc = False
if city.find("政策") != -1:
zc = True
city = city.replace("政策", "")
city = NewsBot.data.get(city)
if city:
policy = "Tips: 查询出行政策可加上 `政策`"
if zc:
policy = await city.policy
await context.edit(f"{city.main_info}\n\n{policy}")
else:

View File

@ -792,10 +792,10 @@
},
{
"name": "covid",
"version": "1.001",
"version": "1.01",
"section": "daily",
"maintainer": "xtaodada",
"size": "3.50 kb",
"size": "3.90 kb",
"supported": true,
"des-short": "获取新冠疫情信息。(国内版)",
"des": "获取新冠疫情信息。(国内版)。\n指令-covid"