diff options
Diffstat (limited to 'code/cogs/lyrics.py')
-rw-r--r-- | code/cogs/lyrics.py | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/code/cogs/lyrics.py b/code/cogs/lyrics.py index f4434d0..e28d2c2 100644 --- a/code/cogs/lyrics.py +++ b/code/cogs/lyrics.py @@ -21,7 +21,10 @@ class Lyrics(commands.Cog): if not self.bot.genius: embed = discord.Embed( title="Lyrics Feature Error", - description="The lyrics feature is currently disabled due to errors with the Genius API.", + description=( + "The lyrics feature is currently disabled due to errors" + " with the Genius API." + ), color=BOT_COLOR, ) embed.set_footer( @@ -30,20 +33,27 @@ class Lyrics(commands.Cog): ) + " UTC" ) - return await interaction.response.send_message(embed=embed, ephemeral=True) + return await interaction.response.send_message( + embed=embed, ephemeral=True + ) # Defer the interaction to avoid getting 404 Not Found errors # if fetching the lyrics takes a long time await interaction.response.defer(ephemeral=True) # Search for the songs lyrics with Genius - song = self.bot.genius.search_song(player.current.title, player.current.author) + song = self.bot.genius.search_song( + player.current.title, player.current.author + ) # If no lyrics are found, send an error message if song is None: embed = discord.Embed( title="Lyrics Not Found", - description="Unfortunately, I wasn't able to find any lyrics for the song that is currently playing.", + description=( + "Unfortunately, I wasn't able to find any lyrics for the" + " song that is currently playing." + ), color=BOT_COLOR, ) embed.set_thumbnail(url=player.current.artwork_url) @@ -64,8 +74,14 @@ class Lyrics(commands.Cog): # If the lyrics are too long, send just a link to the lyrics if len(lyrics) > 2048: embed = discord.Embed( - title=f"Lyrics for {player.current.title} by {player.current.author}", - description=f"Song lyrics are too long to display on Discord. [Click here to view the lyrics on Genius]({song.url}).", + title=( + f"Lyrics for {player.current.title} by" + f" {player.current.author}" + ), + description=( + "Song lyrics are too long to display on Discord. [Click" + f" here to view the lyrics on Genius]({song.url})." + ), color=BOT_COLOR, ) embed.set_thumbnail(url=player.current.artwork_url) @@ -79,7 +95,9 @@ class Lyrics(commands.Cog): # If everything is successful, send the lyrics embed = discord.Embed( - title=f"Lyrics for {player.current.title} by {player.current.author}", + title=( + f"Lyrics for {player.current.title} by {player.current.author}" + ), description=f"Provided from [Genius]({song.url})\n\n" + lyrics, color=BOT_COLOR, ) |