memes.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:dogbot 作者: slice 项目源码 文件源码
def export_image(ctx: DogbotContext, image: Image, filename: str):
    with BytesIO() as bio:
        # Export the image.
        coro = ctx.bot.loop.run_in_executor(None, functools.partial(image.save, bio, format='png'))
        await asyncio.wait([coro], loop=ctx.bot.loop, timeout=5)

        # Upload to the channel.
        bio.seek(0)
        await ctx.send(file=discord.File(bio, filename))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号