REF: Changed up the Embed to show the thumbnail
This commit is contained in:
parent
7f5aeb04c3
commit
fa6cd7b5ea
@ -81,11 +81,18 @@ class Music:
|
|||||||
if info:
|
if info:
|
||||||
url = info['url']
|
url = info['url']
|
||||||
title = info.get('title')
|
title = info.get('title')
|
||||||
|
uploader = info.get('uploader', 'Unknown')
|
||||||
|
duration = info.get('duration', 0)
|
||||||
|
thumbnail = info.get('thumbnail', '')
|
||||||
self.logger.debug(f'Playing URL: {url}')
|
self.logger.debug(f'Playing URL: {url}')
|
||||||
try:
|
try:
|
||||||
source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(url), volume=self.volume)
|
ffmpeg_options = {
|
||||||
|
'options': f'-vn -filter:a "volume={self.volume}"'
|
||||||
|
}
|
||||||
|
source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(url, **ffmpeg_options), volume=self.volume)
|
||||||
interaction.guild.voice_client.play(source)
|
interaction.guild.voice_client.play(source)
|
||||||
embed = discord.Embed(description=f'Now playing: **{title}**', color=discord.Color.green())
|
embed = discord.Embed(title=title, description=f"Uploader: {uploader}\nDuration: {duration // 60}:{duration % 60:02d}", color=discord.Color.green())
|
||||||
|
embed.set_thumbnail(url=thumbnail)
|
||||||
await interaction.followup.send(embed=embed)
|
await interaction.followup.send(embed=embed)
|
||||||
self.logger.info(f'Now playing: {title}')
|
self.logger.info(f'Now playing: {title}')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user