Corona updates

This commit is contained in:
Mark Hoekveen
2020-03-24 15:45:17 +01:00
parent dddcaceb00
commit 4bd13d2b04
+15
View File
@@ -120,6 +120,21 @@ class Shitpost(object):
print("No permission to delete message") print("No permission to delete message")
yield from ctx.channel.send(ctx.author.mention + ' ' + str(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) @commands.command(pass_context=True, hidden=False)
@asyncio.coroutine @asyncio.coroutine
def viertwintig(self, ctx): def viertwintig(self, ctx):