📜  discord.File(fp=image_binary,filename=name) discord py - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:15.506000             🧑  作者: Mango

代码示例1
image = Image.open("test.png")

with BytesIO() as image_binary:
    image.save(image_binary, "PNG")
    image_binary.seek(0)
    await ctx.send(file=discord.File(fp=image_binary,filename="image.png"))