mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-20 02:26:32 +01:00
Fix jimmy converter
This commit is contained in:
parent
d4358db5d1
commit
7b5cd0e8c2
1 changed files with 3 additions and 2 deletions
|
@ -1455,10 +1455,11 @@ class OtherCog(commands.Cog):
|
||||||
await image.save(f)
|
await image.save(f)
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
img = await self.bot.loop.run_in_executor(None, Image.open, f)
|
img = await self.bot.loop.run_in_executor(None, Image.open, f)
|
||||||
if img.format not in ("PNG", "JPEG", "WEBP", "HEIF", "BMP", "TIFF"):
|
if img.format.upper() not in ("PNG", "JPEG", "WEBP", "HEIF", "BMP", "TIFF"):
|
||||||
return await ctx.respond("Image must be PNG or JPEG")
|
return await ctx.respond("Image must be PNG or JPEG")
|
||||||
with tempfile.TemporaryFile("wb+") as f2:
|
with tempfile.TemporaryFile("wb+") as f2:
|
||||||
await self.bot.loop.run_in_executor(None, img.save, f2, format="GIF")
|
caller = partial(img.save, f2, format="GIF")
|
||||||
|
await self.bot.loop.run_in_executor(None, caller)
|
||||||
f2.seek(0)
|
f2.seek(0)
|
||||||
try:
|
try:
|
||||||
await ctx.respond(file=discord.File(f2, filename="image.gif"))
|
await ctx.respond(file=discord.File(f2, filename="image.gif"))
|
||||||
|
|
Loading…
Reference in a new issue