diff --git a/Music-bot/bot.py b/Music-bot/bot.py index b8dff791aff32dde93574ff3fe75989a2f27e43c..c8bfcb34658c0f0664809811bfd315dafa5ce722 100644 --- a/Music-bot/bot.py +++ b/Music-bot/bot.py @@ -37,6 +37,7 @@ if __name__ == '__main__': except: print(f'Failed to load extension {extension}.', file=sys.stderr) traceback.print_exc() + bot.run(dev_token) -bot.run(dev_token) -#bot.run(production_token) +# +# bot.run(production_token) diff --git a/Music-bot/cogs/music.py b/Music-bot/cogs/music.py index efa0d5c69c2c2212db52e5c911a3b1ee5ff8f1da..35d4f69b31d811c1c78aa5a50cde7d9409ad8253 100644 --- a/Music-bot/cogs/music.py +++ b/Music-bot/cogs/music.py @@ -17,6 +17,7 @@ import itertools import sys import traceback from functools import partial +from typing import List import discord import youtube_dl @@ -310,11 +311,14 @@ class Music: vc.resume() await ctx.send(f'**`{ctx.author}`**: Resumed the song!') - @commands.command(name='vote_skip') + @commands.command(name='vote_skip', enabled=False) async def vote_skip_(self, ctx): """Skips the song if the required votes have been acquired""" vc = ctx.voice_client - votes = [] + + votes: List[str] = [] + votes_needed = int(3) + vote_count = int(0) if not vc or not vc.is_connected(): return await ctx.send('I am not currently playing anything!', delete_after=20) @@ -326,9 +330,15 @@ class Music: if not {ctx.author} in votes: votes.append(f'{ctx.author}') + await ctx.send(f"There is now {len(votes)} votes!") + await ctx.send(votes) elif {ctx.author} in votes: await ctx.send(f"**`{ctx.author}`**: You have already voted") + if len(votes) == votes_needed or len(votes) > votes_needed: + await ctx.send("We have enough votes to skip, skipping.") + vc.stop() + @commands.command(name='skip') @checks.song_requester_or_dj() async def skip_(self, ctx):