Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
pre-commit-ci[bot] committed Jul 27, 2024
1 parent 304894c commit 23ce5d9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions palette/palette.py
Original file line number Diff line number Diff line change
@@ -70,17 +70,15 @@ async def palette(
if not image:
image = str(ctx.author.display_avatar)
if attachments := ctx.message.attachments:
valid_attachments = [
a for a in attachments if a.content_type.startswith("image/")
]
valid_attachments = [a for a in attachments if a.content_type.startswith("image/")]
if valid_attachments:
image = valid_attachments[0].url

async with ctx.typing():
img = await self.get_img(image)
if isinstance(img, dict):
return await ctx.send(img["error"])

colors, file = await self.bot.loop.run_in_executor(
None, self.create_palette, img, amount, detailed, sort
)

0 comments on commit 23ce5d9

Please sign in to comment.