Skip to content

Commit

Permalink
Fix udb for the new api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LightSage committed Jul 20, 2024
1 parent 21acdf6 commit 9125b6f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lightning/cogs/homebrew/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ def __init__(self, entries):
super().__init__(entries, per_page=1)

async def format_page(self, menu, entry):
desc: str = entry['description'] if 'description' in entry else "No description found..."
desc: str = entry['description'] or "No description found..."
embed = discord.Embed(title=entry['title'], color=discord.Color.blurple(), description=desc)

if 'downloads' in entry:
if entry['downloads']:
downloads = [f"[{k}]({v['url']})" for k, v in entry['downloads'].items()]
joined = "\n".join(downloads)

Expand All @@ -72,12 +72,12 @@ async def format_page(self, menu, entry):
embed.add_field(name="Latest Downloads", value=joined)

# We probably don't have a qr if there's no downloads but whatever
if 'qr' in entry:
if entry['qr']:
embed.set_thumbnail(url=list(entry['qr'].values())[0])

embed.set_author(name=entry['author'])

if 'updated' in entry:
if entry['updated']:
embed.timestamp = dateutil.parser.parse(entry['updated'])
embed.set_footer(text="Last updated at")

Expand Down

0 comments on commit 9125b6f

Please sign in to comment.