Reputation: 53
I want to post an embed with a thumbnail on it, with a local file on my PC. Whenever I try to run this code, the image is sent outside the embed.
embedVar = discord.Embed(title="title",
description="desc.",
color=0X19A6FF)
file = discord.File("file_location/file.png", filename="image.png")
embedVar.set_thumbnail(url="attachment://file_location/file.png")
await message.channel.send(file=file, embed=embedVar)
Upvotes: 4
Views: 4443
Reputation: 15689
The filename in the File
constructor and the filename in the URL
have to match. Currently you're passing the whole path, it's supposed to be only the name
embedVar.set_thumbnail(url="attachment://image.png")
Upvotes: 6