I am wondering how I can make my bot upload an embedded image to a Discord channel. I know how to make it send embeds, but how do I upload an embedded image? Is it even possible with discord.py? Keep in mind I am not referring to the thumbnail image you can have in an embed image, I am wondering if you even can upload an embed image using Python. Thanks!
Definition: Embedding refers to the integration of links, images, videos, gifs and other content into social media posts or other web media. Embedded content appears as part of a post and supplies a visual element that encourages increased click through and engagement.
This is the easiest way to embed images into an email without learning how to code. Email providers, like Gmail, allow you to drag an image from a folder and drop it into an area inside the compose box that says “attach files here”.
Embedding an image into an email message is the act of adding the image into the coding of the email template for it to appear amongst the text once the subscriber opens it, instead of appearing as an email attachment.
To send an image in an embed, use the set_image
method of the embed:
e = discord.Embed()
e.set_image(url="https://discordapp.com/assets/e4923594e694a21542a489471ecffa50.svg")
To send a file from your PC, use the send_file
method in async branch or the send
method in rewrite branch.
# Async
await bot.send_file(channel, "filepath.png", content="...", filename="...")
# Rewrite
file = discord.File("filepath.png", filename="...")
await channel.send("content", file=file)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With