I was deleting the message too early for the grayscale to work

pull/8/head
sgoudham 4 years ago
parent ce8830ee22
commit 7acc89952c

@ -438,8 +438,6 @@ class Fun(Cog):
"""Display grayscale version of image uploaded"""
if ctx.message.attachments:
await ctx.message.delete()
for attachments in ctx.message.attachments:
attach = await attachments.read()
image = Image.open(io.BytesIO(attach)).convert('LA')
@ -449,6 +447,7 @@ class Fun(Cog):
image.save(file, format='PNG')
file.seek(0)
await ctx.message.delete()
# Send Grayscale Image
await ctx.send(file=discord.File(file, "gp.png"))
else:

Loading…
Cancel
Save