covid fix a bug

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

View File

@ -1,4 +1,4 @@
# https://github.com/Zeta-qixi/nonebot-plugin-covid19-news """ https://github.com/Zeta-qixi/nonebot-plugin-covid19-news """
import json import json
from typing import Dict from typing import Dict
@ -128,6 +128,7 @@ async def covid_info(context):
return await context.edit("[covid] 无法获取城市名!") return await context.edit("[covid] 无法获取城市名!")
city = NewsBot.data.get(city) city = NewsBot.data.get(city)
if city: if city:
await context.edit(f"{city.main_info}\n\n{await city.policy}") policy = await city.policy
await context.edit(f"{city.main_info}\n\n{policy}")
else: else:
await context.edit("[covid] 只限查询国内城市或你地理没学好。") await context.edit("[covid] 只限查询国内城市或你地理没学好。")

View File

@ -792,7 +792,7 @@
}, },
{ {
"name": "covid", "name": "covid",
"version": "1.0", "version": "1.001",
"section": "daily", "section": "daily",
"maintainer": "xtaodada", "maintainer": "xtaodada",
"size": "3.50 kb", "size": "3.50 kb",