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.
This commit is contained in:
parent
331b266ec3
commit
75ec7983fc
@ -39,6 +39,9 @@ class Skip(commands.Cog):
|
|||||||
else:
|
else:
|
||||||
for i in range(number - 2, -1, -1):
|
for i in range(number - 2, -1, -1):
|
||||||
player.queue.pop(i)
|
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
|
# 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.
|
# so, when a user attempts to skip to that track, we get a LoadError. In this case, just pass it.
|
||||||
try:
|
try:
|
||||||
@ -57,13 +60,13 @@ class Skip(commands.Cog):
|
|||||||
|
|
||||||
# It takes a sec for the new track to be grabbed and played
|
# It takes a sec for the new track to be grabbed and played
|
||||||
# So just wait a sec before sending the message
|
# So just wait a sec before sending the message
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(0.5)
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title="Track Skipped",
|
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,
|
color=BOT_COLOR,
|
||||||
)
|
)
|
||||||
embed.set_thumbnail(url=player.current.artwork_url)
|
embed.set_thumbnail(url=next_song.artwork_url)
|
||||||
embed.set_footer(
|
embed.set_footer(
|
||||||
text=datetime.datetime.now(datetime.timezone.utc).strftime(
|
text=datetime.datetime.now(datetime.timezone.utc).strftime(
|
||||||
"%Y-%m-%d %H:%M:%S"
|
"%Y-%m-%d %H:%M:%S"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user