Defer responses

This commit is contained in:
Nexus 2023-05-25 09:55:02 +01:00
parent ec81491637
commit 97bb88fd5c
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -1455,6 +1455,7 @@ class OtherCog(commands.Cog):
)
):
"""Converts a static image to a gif, so you can save it"""
await ctx.defer()
image: discord.Attachment
with tempfile.TemporaryFile("wb+") as f:
await image.save(f)
@ -1481,6 +1482,7 @@ class OtherCog(commands.Cog):
@commands.message_command(name="Convert Image to GIF")
async def convert_image_to_gif(self, ctx: discord.ApplicationContext, message: discord.Message):
await ctx.defer()
for attachment in message.attachments:
if attachment.content_type.startswith("image/"):
break