Reputation: 25
I embed a image using this code, it doesn't throw any error and it send a embed but nothing is there in the embed.
e=discord.Embed()
file = discord.File("OWO.jpg", filename="OWO.jpg")
e.set_thumbnail(url="attachment://OWO.jpg")
msg = ctx.send(embed=e)
This is my embed image look like, There's nothing in it.
Upvotes: 1
Views: 2913
Reputation: 370
Discord special-cases uploading an image attachment and using it within an embed so that it will not display separately, but instead in the embed’s thumbnail, image, footer or author icon.
To do so, upload the image normally with abc.Messageable.send(), and set the embed’s image URL to attachment://image.png, where image.png is the filename of the image you will send.
Quick example:
file = discord.File("path/to/my/image.png", filename="image.png")
embed = discord.Embed()
embed.set_image(url="attachment://image.png")
await channel.send(file=file, embed=embed)
Note: Due to a Discord limitation, filenames may not include underscores.
Is there an event for audit log entries being created?
Upvotes: 2
Reputation: 15689
You also need to send the file
msg = await ctx.send(embed=e, file=file)
Upvotes: 0