From 25e743a16a71844a444791ba019d2f15fd772b0a Mon Sep 17 00:00:00 2001 From: shahriyar Date: Tue, 8 Feb 2022 17:12:31 +0600 Subject: [PATCH] Fix grammer and added queue length in queue command --- dismusic/music.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dismusic/music.py b/dismusic/music.py index 5c00b04..c21803a 100644 --- a/dismusic/music.py +++ b/dismusic/music.py @@ -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.") @@ -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: @@ -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"])