diff --git a/Shitpost.py b/Shitpost.py index d619392..6ebdafd 100644 --- a/Shitpost.py +++ b/Shitpost.py @@ -120,6 +120,21 @@ class Shitpost(object): print("No permission to delete message") yield from ctx.channel.send(ctx.author.mention + ' ' + str(message)) + @commands.command(pass_context=True, hidden=False) + @asyncio.coroutine + def corona(self, ctx): + params = ( + ('minimal/', 'true'), + ('format/', 'json') + ) + response = requests.get('https://corona-stats.online/NL/?format=json&source=2') + answer = json.loads(response.content) + answer = answer["data"] + message = "Volgens mij zijn er in Nederland " + str(answer[0]["cases"]) + " bevestigde gevallen " + message += "en " + str(answer[0]["deaths"]) + " dooies 💀, en liggen er " + message += str(answer[0]["critical"]) + " mensen op de IC. " + yield from ctx.channel.send(ctx.author.mention + ' ' + str(message)) + @commands.command(pass_context=True, hidden=False) @asyncio.coroutine def viertwintig(self, ctx):