From 43bb87f997a736ee93a62cc1b47de2939a93b209 Mon Sep 17 00:00:00 2001 From: Rafael Vargas Date: Thu, 30 Dec 2021 17:08:27 -0400 Subject: [PATCH] Adding shuffle musics command --- vulkanbot/music/Music.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vulkanbot/music/Music.py b/vulkanbot/music/Music.py index 12a609c..7cb5c75 100644 --- a/vulkanbot/music/Music.py +++ b/vulkanbot/music/Music.py @@ -86,6 +86,7 @@ class Music(commands.Cog): await self.__send_embed(ctx, description='Houve um problema no download dessa música, tente novamente', colour_name='blue') elif not self.__playing : # If not playing + await self.__send_embed(ctx, description=f'Você adicionou a música **{song.title}** à playlist', colour_name='blue') else: # If playing @@ -195,6 +196,15 @@ class Music(commands.Cog): ) await ctx.send(embed=embedvc) + @commands.command(name='shuffle', help='Altera aleatoriamente a ordem das músicas') + async def shuffle(self, ctx): + self.__playlist.shuffle() + songs = self.__playlist.songs_to_preload + + await self.__downloader.preload(songs) + + await self.__send_embed(ctx, description='Musicas embaralhadas', colour_name='blue') + def setup(bot): bot.add_cog(Music(bot))