From d77d7bed79b00877cdc4a254db4c79aea8a34563 Mon Sep 17 00:00:00 2001 From: Nick80835 Date: Mon, 16 Mar 2020 21:03:26 -0400 Subject: [PATCH] corona --- ubot/modules/evaluation.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ubot/modules/evaluation.py b/ubot/modules/evaluation.py index a1a7e88..a6dc81b 100644 --- a/ubot/modules/evaluation.py +++ b/ubot/modules/evaluation.py @@ -4,12 +4,20 @@ import inspect import io from PIL import Image +from requests import get from ubot.micro_bot import micro_bot ldr = micro_bot.loader +@ldr.add(pattern="corona") +async def corona(event): + corona_data = get("https://corona.lmao.ninja/all").json() + response_text = f"`Cases: `**{corona_data['cases']}**\n`Deaths: `**{corona_data['deaths']}**\n`Recoveries: `**{corona_data['recovered']}**" + await event.reply(response_text) + + @ldr.add(pattern="chatid") async def chatidgetter(event): if event.is_reply: