F
F
FarQ2020-10-21 19:52:26
Python
FarQ, 2020-10-21 19:52:26

How can I make the bot send a file that is on my computer?

Is there anything I can do to send a file that is on my computer? I've been looking for a very long time and can't find it. Thanks in advance.

@bot.command()
async def say(ctx, *, text):
    img = Image.open('Picture.png')

    idraw = ImageDraw.Draw(img)

    headline = ImageFont.truetype("arialbi.ttf", size = 43)

    idraw.text((27, 754), text, font = headline)

    img.save('send.png')
    await bot.send_file("send.png")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Nevzorov, 2020-10-21
​​@FarQ

https://discordpy.readthedocs.io/en/stable/api.htm...
await ctx.send(file=discord.File("send.png"))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question