Discord.py: Is there a way to post a local image?

Created on 30 May 2017  路  3Comments  路  Source: Rapptz/discord.py

Posting an image link is easy:

@bot.group(pass_context=True)
async def john(ctx):

    if ctx.invoked_subcommand is None:
        await bot.say('https://i.imgur.com/rZWO3QB.png'.format(ctx))

But changing the URL to something like C:/blah/blah/blah.png obviously doesn't work. Is it possible?

question

Most helpful comment

bot.upload is the commands ext equivalent of Client.send_file.

All 3 comments

bot.upload is the commands ext equivalent of Client.send_file.

For posting a _local_ image in an _embed_, see this StackOverflow thread:
https://stackoverflow.com/questions/61578927/use-a-local-file-as-the-set-image-file-discord-py/61579108#61579108

(It's compatible with the rewrite of discord.py)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TunaHobby picture TunaHobby  路  3Comments

Nicba1010 picture Nicba1010  路  3Comments

JackL0 picture JackL0  路  3Comments

jzburda picture jzburda  路  3Comments

Yolotroll101 picture Yolotroll101  路  3Comments