paper-dynasty-discord/utilities/embeds.py
Cal Corum ee80cd72ae fix: apply Black formatting and resolve ruff lint violations
Run Black formatter across 83 files and fix 1514 ruff violations:
- E722: bare except → typed exceptions (17 fixes)
- E711/E712/E721: comparison style fixes with noqa for SQLAlchemy (44 fixes)
- F841: unused variable assignments (70 fixes)
- F541/F401: f-string and import cleanup (1383 auto-fixes)

Remaining 925 errors are all F403/F405 (star imports) — structural,
requires converting to explicit imports in a separate effort.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 11:37:46 -05:00

32 lines
907 B
Python

import discord
from helpers import IMAGES, PD_SEASON, SBA_COLOR
def image_embed(
image_url: str,
title: str = None,
color: str = None,
desc: str = None,
author_name: str = None,
author_icon: str = None,
thumbnail_url: str = None,
):
embed_color = int(SBA_COLOR, 16)
if color is not None:
embed_color = int(color, 16)
embed = discord.Embed(color=embed_color)
if title is not None:
embed.title = title
if desc is not None:
embed.description = desc
if author_name is not None:
icon = author_icon if author_icon is not None else IMAGES["logo"]
embed.set_author(name=author_name, icon_url=icon)
if thumbnail_url is not None:
embed.set_thumbnail(url=thumbnail_url)
embed.set_footer(text=f"Paper Dynasty Season {PD_SEASON}", icon_url=IMAGES["logo"])
embed.set_image(url=image_url)
return embed