covid-en fix a bug

This commit is contained in:
xtaodada 2021-12-19 13:50:41 +08:00
parent 79e8b4f668
commit 81314b5490
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 5 additions and 2 deletions

View File

@ -16,7 +16,10 @@ async def covid_en(context):
except ValueError:
country = "World"
covid_ = Covid(source="worldometers")
country_data = covid_.get_status_by_country_name(country)
try:
country_data = covid_.get_status_by_country_name(country)
except ValueError:
return await context.edit("[covid-en] 国家名称不正确 **[Worldometer]**(https://www.worldometers.info/coronavirus)")
if country_data:
if country == "World":
country_data['total_tests'] = "未知"

View File

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