From 549f660c87b3e051537057f179164e34e82cabd4 Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Thu, 17 Sep 2020 21:43:59 +0200 Subject: [PATCH] Adds playlist status command --- General.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/General.py b/General.py index eb33aac..3cf5a3f 100644 --- a/General.py +++ b/General.py @@ -4,6 +4,7 @@ import sys, os import praw import random import re +import json, requests from discord.ext import commands from sympy import latex, symbols, preview, Symbol #for LaTeX images import youtube_dl @@ -141,6 +142,20 @@ class General(commands.Cog): ) yield from ctx.channel.send(ctx.author.mention + ' hoi ', file=discord.File('out.gif')) + @commands.command(pass_context=True) + @asyncio.coroutine + def playlist(self, ctx): + """HDcon2020 playlist""" + muzak_url = 'https://hdcon-muzak.herokuapp.com' + data = json.loads(requests.get(muzak_url + '/stroopwafel').content) # als dit faalt yolo no catch + msg = 'Stemmen en nomineren kan hier: {}\n'.format(muzak_url) + msg += '*Er zijn al {} nummers genomineerd*\n'.format(data['stemCount']) + msg += '**High scores:**\n```' + for user in data['userList']: + msg += '{} {}\n'.format((user['name']+":").ljust(9), user['score']) + msg += '```' + yield from ctx.channel.send(msg) + @commands.command(pass_context=True, hidden=True) @asyncio.coroutine def reboot(self, ctx, password=""):