Skip to content

Commit

Permalink
Fix handling of posts without a thumbnail image
Browse files Browse the repository at this point in the history
  • Loading branch information
raccube committed Sep 3, 2024
1 parent b12c959 commit 36d7fda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sr/discord_bot/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def create_embed(post: FeedParserDict) -> discord.Embed:
description=text,
)

if len(post.media_thumbnail) > 0:
embed.set_image(url=post.media_thumbnail[0]['url'])
if post.has_key('media_thumbnail'):
embed.set_image(url=post['media_thumbnail'][0]['url'])

return embed

0 comments on commit 36d7fda

Please sign in to comment.