python-discord / meta

Issue tracker for suggestions and other questions relating to our community
https://pythondiscord.com
31 stars 5 forks source link

Add "Local File to Embed" tag #131

Closed ChiliMX closed 3 years ago

ChiliMX commented 3 years ago

Create a .md file in /tags with the following content inside:

f = discord.File("some_file_path", filename="image.png")
e = discord.Embed()
e.set_image(url="attachment://image.png")
await messagable.send(file=f, embed=e)

# Note that the filename in the File constructor and the filename in the URL must match.

Docs: https://discordpy.readthedocs.io/en/latest/faq.html#how-do-i-use-a-local-image-file-for-an-embed-image


This question is frequently asked in the discord.py channel, so having a tag would make a lot of sense, and save a lot of time.

Xithrius commented 3 years ago

Greetings, human @ChiliPy.

I approve of this idea of creating a discord.py tag for attaching an image within an embed, but I fear it is not giving a proper explanation of what's going on.

I'd suggest including what's in the docs, and maybe adding some information on top of it, if you'd like. Doesn't have to be a clone of the doc's description of what's going on, it can be in your own words.

We can shuffle all this around in a PR if you decide to make one, or if you'd prefer someone else to do it.

ChiliMX commented 3 years ago

Tbh I'm kinda stupid and dunno how to make a PR, so If someone who ants to they can

Xithrius commented 3 years ago

Tbh I'm kinda stupid and dunno how to make a PR, so If someone who ants to they can

If you're new to git, I recommend this video as a crash course.