Skip to content
This repository was archived by the owner on Sep 29, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions userbot/modules/covid.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@
# Port to UserBot by @MoveAngel

from covid import Covid

from userbot import CMD_HELP
from userbot.events import register


@register(outgoing=True, pattern="^.covid (.*)")
register(outgoing=True, pattern="^.covid (.*)")
async def corona(event):
await event.edit("`Processing...`")
country = event.pattern_match.group(1)
ntry = event.pattern_match.group(1)
covid = Covid(source="worldometers")
try:
country_data = covid.get_status_by_country_name(country)
status_by_country_name(country)
output_text = (
f"`Confirmed : {country_data['confirmed']}`\n"
+ f"`Active : {country_data['active']}`\n"
Expand All @@ -39,6 +34,6 @@ async def corona(event):
CMD_HELP.update(
{
"covid": ".covid <country>"
"\nUsage: Get an information about data covid-19 in your country.\n"
}
)
information about data covid-19 in your country.\n"