update with bugfixes

This commit is contained in:
a 2022-06-29 11:03:26 -05:00
parent 8d3e7b6356
commit 83bc13a2c0
1 changed files with 13 additions and 13 deletions

View File

@ -519,14 +519,14 @@ class Music(Cog):
): ):
logger.debug(f"add_to_queue({query}) called") logger.debug(f"add_to_queue({query}) called")
# Check for permission to add tracks # Check for permission to add tracks
allowed = self.check_for_numbers(ctx) # allowed = self.check_for_numbers(ctx)
if not allowed: # if not allowed:
logger.info(f"{ctx.author} is not allowed to add to queue") # logger.info(f"{ctx.author} is not allowed to add to queue")
#return await ctx.send( # #return await ctx.send(
#"You must be in a voice chat by yourself " # #"You must be in a voice chat by yourself "
#"in order to use this command." # #"in order to use this command."
#) # #)
return await ctx.send("No 💜") # return await ctx.send("No 💜")
# Ensure we are connected to voice # Ensure we are connected to voice
if not ctx.voice_client: if not ctx.voice_client:
logger.warning("no voice client") logger.warning("no voice client")
@ -664,7 +664,7 @@ class Music(Cog):
source: Player = ctx.voice_client.source source: Player = ctx.voice_client.source
embed = discord.Embed( embed = discord.Embed(
title=f"{self.track.title}", 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( ).add_field(
name="Progress", name="Progress",
value=f"{source.progress}", value=f"{source.progress}",
@ -673,10 +673,10 @@ class Music(Cog):
icon_url=f"{self.track.requester.display_avatar.url}", icon_url=f"{self.track.requester.display_avatar.url}",
) )
thumb = None thumb = None
if "thumbnail" in source.data: if self.track.data and "thumbnail" in self.track.data:
thumb = source.data['thumbnail'] thumb = self.track.data['thumbnail']
elif "thumbnails" in source.data: elif self.track.data and "thumbnails" in self.track.data:
thumb = source.data['thumbnails'][0]['url'] thumb = self.track.data['thumbnails'][0]['url']
if thumb: if thumb:
embed.set_thumbnail( embed.set_thumbnail(
url=thumb url=thumb