1
Fork 0
mirror of https://github.com/allthingslinux/tux.git synced 2024-10-02 16:43:12 +00:00

Merge pull request #481 from allthingslinux/Ow0cast-patch-1

feat: defer processing message instead of reply
This commit is contained in:
electron271 2024-08-28 21:34:24 -05:00 committed by GitHub
commit f446ea6359
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -50,7 +50,7 @@ class ImgEffect(commands.Cog):
# say that the image is being processed
logger.info("Processing image...")
await interaction.response.send_message("Processing image...")
await interaction.response.defer(ephemeral=True)
# open url with PIL
logger.info("Opening image with PIL and HTTPX...")
@ -89,8 +89,8 @@ class ImgEffect(commands.Cog):
pil_image.save(arr, format="JPEG", quality=1)
arr.seek(0)
file = discord.File(arr, filename="deepfried.jpg")
# edit message with image
await interaction.followup.send(content="Here is your deepfried image:", file=file)
await interaction.followup.send(file=file, ephemeral=True)
async def setup(bot: commands.Bot) -> None: