1
0
Fork 0
mirror of synced 2024-05-20 20:42:27 +12:00

Change entry to print an embed instead of a message

This commit is contained in:
Phxntxm 2017-05-07 21:16:51 -05:00
parent 1e451942be
commit 8f9e514260
2 changed files with 8 additions and 2 deletions

View file

@ -68,7 +68,9 @@ class VoiceState:
try:
self.current = await self.songs.get_next_entry()
await song.channel.send("Now playing {}".format(self.current))
embed = self.current.to_embed()
embed.title = "Now playing!"
await song.channel.send(embed=embed)
except ExtractionError as e:
await song.channel.send("Failed to download {}!\nError: {}".format(self.current.title, e))
continue
@ -333,7 +335,9 @@ class Music:
if entry is None:
await ctx.send("Sorry but I couldn't download/find {}".format(song))
else:
await ctx.send("Enqueued {}".format(entry))
embed = entry.to_embed()
embed.title = "Enqueued song!"
await ctx.send(embed=embed)
@commands.command(pass_context=True)
@commands.guild_only()

View file

@ -285,6 +285,8 @@ class URLPlaylistEntry(BasePlaylistEntry):
# Fill in the simple things
embed.add_field(name='Title', value=self.title, inline=False)
embed.add_field(name='Requester', value=self.requester.display_name, inline=False)
if self.thumbnail:
embed.set_thumbnail(url=self.thumbnail)
# Get the current length of the song and display this
length = divmod(round(self.length, 0), 60)
fmt = "{0[0]}m {0[1]}s".format(length)