From 83bc13a2c013e1cf403a19e5fe2b1dcc40248d4f Mon Sep 17 00:00:00 2001 From: a Date: Wed, 29 Jun 2022 11:03:26 -0500 Subject: [PATCH] update with bugfixes --- cogs/music.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cogs/music.py b/cogs/music.py index 0b10162..21feaba 100644 --- a/cogs/music.py +++ b/cogs/music.py @@ -519,14 +519,14 @@ class Music(Cog): ): logger.debug(f"add_to_queue({query}) called") # Check for permission to add tracks - allowed = self.check_for_numbers(ctx) - if not allowed: - logger.info(f"{ctx.author} is not allowed to add to queue") - #return await ctx.send( - #"You must be in a voice chat by yourself " - #"in order to use this command." - #) - return await ctx.send("No 💜") + # allowed = self.check_for_numbers(ctx) + # if not allowed: + # logger.info(f"{ctx.author} is not allowed to add to queue") + # #return await ctx.send( + # #"You must be in a voice chat by yourself " + # #"in order to use this command." + # #) + # return await ctx.send("No 💜") # Ensure we are connected to voice if not ctx.voice_client: logger.warning("no voice client") @@ -664,7 +664,7 @@ class Music(Cog): source: Player = ctx.voice_client.source embed = discord.Embed( title=f"{self.track.title}", - url=f"{self.track.source}", + url=f"{self.track.source}" if self.track.source.startswith('http') else None, ).add_field( name="Progress", value=f"{source.progress}", @@ -673,10 +673,10 @@ class Music(Cog): icon_url=f"{self.track.requester.display_avatar.url}", ) thumb = None - if "thumbnail" in source.data: - thumb = source.data['thumbnail'] - elif "thumbnails" in source.data: - thumb = source.data['thumbnails'][0]['url'] + if self.track.data and "thumbnail" in self.track.data: + thumb = self.track.data['thumbnail'] + elif self.track.data and "thumbnails" in self.track.data: + thumb = self.track.data['thumbnails'][0]['url'] if thumb: embed.set_thumbnail( url=thumb