diff options
Diffstat (limited to 'code/cogs/autoplay.py')
-rw-r--r-- | code/cogs/autoplay.py | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/code/cogs/autoplay.py b/code/cogs/autoplay.py index af217f9..4b2f624 100644 --- a/code/cogs/autoplay.py +++ b/code/cogs/autoplay.py @@ -25,7 +25,11 @@ class Autoplay(commands.Cog): embed = discord.Embed( title="Autoplay Off", - description="Autoplay has been turned off. I will no longer automatically add new songs to the queue based on AI recommendations.", + description=( + "Autoplay has been turned off. I will no longer" + " automatically add new songs to the queue based on AI" + " recommendations." + ), color=BOT_COLOR, ) return await interaction.response.send_message(embed=embed) @@ -35,17 +39,28 @@ class Autoplay(commands.Cog): if interaction.guild.id in self.bot.autoplay: embed = discord.Embed( title="Autoplay Already Enabled", - description="Autoplay is already enabled. If you would like to turn it off, choose the `OFF` option in the </autoplay:1228216490386391052> command.", + description=( + "Autoplay is already enabled. If you would like to turn it" + " off, choose the `OFF` option in the" + " </autoplay:1228216490386391052> command." + ), color=BOT_COLOR, ) - return await interaction.response.send_message(embed=embed, ephemeral=True) + return await interaction.response.send_message( + embed=embed, ephemeral=True + ) player = self.bot.lavalink.player_manager.get(interaction.guild.id) if len(player.queue) < 5: embed = discord.Embed( title="Not Enough Context", - description="You must have at least 5 songs in the queue so that I can get a good understanding of what music I should continue to play. Add some more music to the queue, then try again.", + description=( + "You must have at least 5 songs in the queue so that I can" + " get a good understanding of what music I should continue" + " to play. Add some more music to the queue, then try" + " again." + ), color=BOT_COLOR, ) embed.set_footer( @@ -54,7 +69,9 @@ class Autoplay(commands.Cog): ) + " UTC" ) - return await interaction.response.send_message(embed=embed, ephemeral=True) + return await interaction.response.send_message( + embed=embed, ephemeral=True + ) inputs = {} for song in player.queue[:10]: @@ -62,16 +79,26 @@ class Autoplay(commands.Cog): embed = discord.Embed( title="Getting AI Recommendations", - description="Attempting to generate recommendations based on the current songs in your queue. Just a moment...", + description=( + "Attempting to generate recommendations based on the current" + " songs in your queue. Just a moment..." + ), color=BOT_COLOR, ) await interaction.response.send_message(embed=embed) - if await add_song_recommendations(self.bot.openai, self.bot.user, player, 5, inputs): + if await add_song_recommendations( + self.bot.openai, self.bot.user, player, 5, inputs + ): self.bot.autoplay.append(interaction.guild.id) embed = discord.Embed( title=":infinity: Autoplay Enabled :infinity:", - description=f"I have added a few similar songs to the queue and will continue to do so once the queue gets low again. Now just sit back and enjoy the music!\n\nEnabled by: {interaction.user.mention}", + description=( + "I have added a few similar songs to the queue and will" + " continue to do so once the queue gets low again. Now" + " just sit back and enjoy the music!\n\nEnabled by:" + f" {interaction.user.mention}" + ), color=BOT_COLOR, ) await interaction.edit_original_response(embed=embed) @@ -79,7 +106,13 @@ class Autoplay(commands.Cog): else: embed = discord.Embed( title="Autoplay Error", - description="Autoplay is an experimental feature, meaning sometimes it doesn't work as expected. I had an error when attempting to get similar songs for you, please try running the command again. If the issue persists, fill out a bug report with the </bug:1224840889906499626> command.", + description=( + "Autoplay is an experimental feature, meaning sometimes it" + " doesn't work as expected. I had an error when attempting" + " to get similar songs for you, please try running the" + " command again. If the issue persists, fill out a bug" + " report with the </bug:1224840889906499626> command." + ), color=BOT_COLOR, ) embed.set_footer( |