Skip to content

Commit

Permalink
Fix grammer and added queue length in queue command
Browse files Browse the repository at this point in the history
  • Loading branch information
shahriyardx committed Feb 8, 2022
1 parent a1e1dac commit 25e743a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion dismusic/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ async def seek(self, ctx: commands.Context, seconds: int):
position = 0

await player.seek(position * 1000)
return await ctx.send(f"Seeked to {seconds} seconds :fast_forward: ")
return await ctx.send(f"Seeked {seconds} seconds :fast_forward: ")

await ctx.send("Player is not playing anything.")

Expand Down Expand Up @@ -224,6 +224,8 @@ async def queue(self, ctx: commands.Context):
)

tracks = ""
length = 0

if player.loop == "CURRENT":
next_song = f"Next > [{player.currently_playing.title}]({player.currently_playing.uri}) \n\n"
else:
Expand All @@ -234,9 +236,19 @@ async def queue(self, ctx: commands.Context):

for index, track in enumerate(player.queue._queue):
tracks += f"{index + 1}. [{track.title}]({track.uri}) \n"
length += track.length

embed.description = tracks

if length > 3600:
length = f"{int(length // 3600)}h {int(length % 3600 // 60)}m {int(length % 60)}s"
elif length > 60:
length = f"{int(length // 60)}m {int(length % 60)}s"
else:
length = f"{int(length)}s"

embed.set_footer(text=length)

await ctx.send(embed=embed)

@commands.command(aliases=["np"])
Expand Down

0 comments on commit 25e743a

Please sign in to comment.