mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
excluse streams from queue duration (#4513)
This commit is contained in:
parent
e31196d19f
commit
454ff90d09
@ -206,7 +206,10 @@ class MiscellaneousUtilities(MixinMeta, metaclass=CompositeMetaClass):
|
|||||||
|
|
||||||
async def queue_duration(self, ctx: commands.Context) -> int:
|
async def queue_duration(self, ctx: commands.Context) -> int:
|
||||||
player = lavalink.get_player(ctx.guild.id)
|
player = lavalink.get_player(ctx.guild.id)
|
||||||
dur = [i.length async for i in AsyncIter(player.queue, steps=50)]
|
dur = [
|
||||||
|
i.length
|
||||||
|
async for i in AsyncIter(player.queue, steps=50).filter(lambda x: not x.is_stream)
|
||||||
|
]
|
||||||
queue_dur = sum(dur)
|
queue_dur = sum(dur)
|
||||||
if not player.queue:
|
if not player.queue:
|
||||||
queue_dur = 0
|
queue_dur = 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user