Adds playlist status command

This commit is contained in:
Mark Hoekveen
2020-09-17 21:43:59 +02:00
parent ef76d1ce1f
commit 549f660c87
+15
View File
@@ -4,6 +4,7 @@ import sys, os
import praw import praw
import random import random
import re import re
import json, requests
from discord.ext import commands from discord.ext import commands
from sympy import latex, symbols, preview, Symbol #for LaTeX images from sympy import latex, symbols, preview, Symbol #for LaTeX images
import youtube_dl 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')) 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) @commands.command(pass_context=True, hidden=True)
@asyncio.coroutine @asyncio.coroutine
def reboot(self, ctx, password=""): def reboot(self, ctx, password=""):