mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-20 02:26:32 +01:00
Defer responses
This commit is contained in:
parent
ec81491637
commit
97bb88fd5c
1 changed files with 2 additions and 0 deletions
|
@ -1455,6 +1455,7 @@ class OtherCog(commands.Cog):
|
||||||
)
|
)
|
||||||
):
|
):
|
||||||
"""Converts a static image to a gif, so you can save it"""
|
"""Converts a static image to a gif, so you can save it"""
|
||||||
|
await ctx.defer()
|
||||||
image: discord.Attachment
|
image: discord.Attachment
|
||||||
with tempfile.TemporaryFile("wb+") as f:
|
with tempfile.TemporaryFile("wb+") as f:
|
||||||
await image.save(f)
|
await image.save(f)
|
||||||
|
@ -1481,6 +1482,7 @@ class OtherCog(commands.Cog):
|
||||||
|
|
||||||
@commands.message_command(name="Convert Image to GIF")
|
@commands.message_command(name="Convert Image to GIF")
|
||||||
async def convert_image_to_gif(self, ctx: discord.ApplicationContext, message: discord.Message):
|
async def convert_image_to_gif(self, ctx: discord.ApplicationContext, message: discord.Message):
|
||||||
|
await ctx.defer()
|
||||||
for attachment in message.attachments:
|
for attachment in message.attachments:
|
||||||
if attachment.content_type.startswith("image/"):
|
if attachment.content_type.startswith("image/"):
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue