mirror of
https://github.com/Fluffy-Bean/Lynxie.git
synced 2025-05-14 08:02:17 +00:00
Merge pull request #6 from Fluffy-Bean/deepsource-transform-513ba6f2
format code with black
This commit is contained in:
commit
7e108350a5
1 changed files with 5 additions and 7 deletions
|
@ -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."
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue