Uploading Both an Image And a Thumbnail to a Discord Embed

Viewed 713

How would I attach both an image (using a file) and attach a thumbnail (using a URL) to a discord embed?

Here's my script:

file = discord.File("cropped.png")
embed.set_image(url = 'attachment://cropped.png')
embed.set_thumbnail(url = icon_URL)
await message.channel.send(file = file, embed = embed)

When the bot sends the embeds, it only sends the image, instead of both the image and the thumbnail. Is this because they're the same thing and the bot can only attach one?

1 Answers

You can send, both an embed and a thumbnail, regardless of what they contain. That is how I send own files in my embeds. Can you share what the variable icon_URL looks like?

file = discord.File("./path/cropped.png", filename="cropped.png")
embed = discord.Embed(colour=0x5865f2)
embed.set_image(url="attachment://cropped.png")
embed.set_thumbnail(url="attachment://cropped.png")
await message.channel.send(file=file, embed=embed)
Related