From 9125b6ffa84e7c2f9d30015a60252b8adfb59b6f Mon Sep 17 00:00:00 2001 From: LightSage Date: Sat, 20 Jul 2024 13:48:34 -0500 Subject: [PATCH] Fix `udb` for the new api changes --- lightning/cogs/homebrew/cog.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lightning/cogs/homebrew/cog.py b/lightning/cogs/homebrew/cog.py index 75dc9e0c..cf9843ad 100644 --- a/lightning/cogs/homebrew/cog.py +++ b/lightning/cogs/homebrew/cog.py @@ -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) @@ -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")