diff options
author | Parker <contact@pkrm.dev> | 2024-04-12 22:54:56 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-04-12 22:54:56 -0500 |
commit | 75ec7983fcaf779cf5e2cf3300e1932039174f65 (patch) | |
tree | bbba6806fdc23129822d30ac850a8c2e24f35934 | |
parent | 331b266ec3a607f156263824a147aedbe5f7ab89 (diff) |
Fix skip command showing wrong song info
Would occasionally show the incorrect song as the song currently playing once the skip command ran. Should be fixed now.
-rw-r--r-- | code/cogs/skip.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/code/cogs/skip.py b/code/cogs/skip.py index 4e9aa7a..7797bc1 100644 --- a/code/cogs/skip.py +++ b/code/cogs/skip.py @@ -39,6 +39,9 @@ class Skip(commands.Cog): else: for i in range(number - 2, -1, -1): player.queue.pop(i) + + next_song = player.queue[0] + # Sometimes when a playlist/album of custom source tracks are loaded, one is not able to be found # so, when a user attempts to skip to that track, we get a LoadError. In this case, just pass it. try: @@ -57,13 +60,13 @@ class Skip(commands.Cog): # It takes a sec for the new track to be grabbed and played # So just wait a sec before sending the message - await asyncio.sleep(1) + await asyncio.sleep(0.5) embed = discord.Embed( title="Track Skipped", - description=f"**Now Playing: [{player.current.title}]({player.current.uri})** by {player.current.author}\n\nQueued by: {player.current.requester.mention}", + description=f"**Now Playing: [{next_song.title}]({next_song.uri})** by {next_song.author}\n\nQueued by: {next_song.requester.mention}", color=BOT_COLOR, ) - embed.set_thumbnail(url=player.current.artwork_url) + embed.set_thumbnail(url=next_song.artwork_url) embed.set_footer( text=datetime.datetime.now(datetime.timezone.utc).strftime( "%Y-%m-%d %H:%M:%S" |