One4uBot icon indicating copy to clipboard operation
One4uBot copied to clipboard

Covid.py

Open FLAEIGN opened this issue 5 years ago • 1 comments

from covid import Covid from userbot import CMD_HELP from userbot.events import register

@register(outgoing=True, pattern="^.coronavirus(?: |$)(.*)") async def corona(event): covid = Covid() data = covid.get_data() country = event.pattern_match.group(1) country_data = get_country_data(country, data) output_text = "" for name, value in country_data.items(): output_text += "{}: {}\n".format(str(name), str(value)) await event.edit("CoronaVirus Info in {}:\n\n{}".format(country.capitalize(), output_text))

def get_country_data(country, world): for country_data in world: if country_data["country"] == country: return country_data return {"Status": "No information yet about this country!"}

CMD_HELP.update({ "covid": ".coronavirus
\nUsage: Get an information about data covid-19 in your country.\n" })

FLAEIGN avatar Sep 05 '20 01:09 FLAEIGN

Seriously We already have this,. And you wanna add again? Mean 1 not enough for you?

https://github.com/MoveAngel/One4uBot/blob/sql-extended/userbot/modules/covid.py

tomiprs0x avatar Sep 21 '20 08:09 tomiprs0x