Merge pull request #6 from Fluffy-Bean/deepsource-transform-513ba6f2

format code with black
This commit is contained in:
Michał Gdula 2023-09-09 00:49:30 +01:00 committed by GitHub
commit 7e108350a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,7 +33,9 @@ class Img(commands.Cog):
elif ctx.message.embeds and ctx.message.embeds[0].image: elif ctx.message.embeds and ctx.message.embeds[0].image:
image_attachments = ctx.message.embeds[0].image image_attachments = ctx.message.embeds[0].image
else: else:
async for message in ctx.guild.get_channel(ctx.channel.id).history(limit=10): async for message in ctx.guild.get_channel(ctx.channel.id).history(
limit=10
):
if message.attachments: if message.attachments:
image_attachments = message.attachments[0] image_attachments = message.attachments[0]
break break
@ -70,8 +72,7 @@ class Img(commands.Cog):
return return
elif ( elif (
image_attachments.url image_attachments.url
and not image_attachments.url.split(".")[-1].lower() and not image_attachments.url.split(".")[-1].lower() in IMAGE_EXTENSIONS
in IMAGE_EXTENSIONS
): ):
error = ( error = (
"Unsupported file type! Supported file types are:\n" "Unsupported file type! Supported file types are:\n"
@ -80,10 +81,7 @@ class Img(commands.Cog):
await ctx.reply(embed=error_message(error)) await ctx.reply(embed=error_message(error))
return return
if ( if image_attachments.size and image_attachments.size > 8 * 1024 * 1024:
image_attachments.size
and image_attachments.size > 8 * 1024 * 1024
):
error = ( error = (
"That image is too big! Please use an image that is less than 8MB." "That image is too big! Please use an image that is less than 8MB."
) )