aboutsummaryrefslogtreecommitdiff
path: root/code/cogs/lyrics.py
diff options
context:
space:
mode:
Diffstat (limited to 'code/cogs/lyrics.py')
-rw-r--r--code/cogs/lyrics.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/code/cogs/lyrics.py b/code/cogs/lyrics.py
index 135aa01..c27589e 100644
--- a/code/cogs/lyrics.py
+++ b/code/cogs/lyrics.py
@@ -61,9 +61,26 @@ class Lyrics(commands.Cog):
lyrics = lyrics.replace("You might also like", "\n")
lyrics = lyrics[:-7]
+ # 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}).",
+ color=BOT_COLOR,
+ )
+ embed.set_thumbnail(url=player.current.artwork_url)
+ embed.set_footer(
+ text=datetime.datetime.now(datetime.timezone.utc).strftime(
+ "%Y-%m-%d %H:%M:%S"
+ )
+ + " UTC"
+ )
+ return await interaction.response.send_message(embed=embed, ephemeral=True)
+
+ # If everything is successful, send the lyrics
embed = discord.Embed(
title=f"Lyrics for {player.current.title} by {player.current.author}",
- description=lyrics,
+ description=f"Provided from [Genius]({song.url})\n\n" + lyrics,
color=BOT_COLOR,
)
embed.set_thumbnail(url=player.current.artwork_url)