Skip to content

Commit

Permalink
Simplify flair check
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCommanderFort committed Aug 13, 2024
1 parent af0e35b commit d07fe28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion process_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async def process_post(submission: Submission):
# Do not respond to memes!
# Or non-image posts.
# god I miss nullish coalescing
if (hasattr(submission, 'link_flair_text') and submission.link_flair_text and ('meme' in submission.link_flair_text.lower() or 'news' in submission.link_flair_text.lower())) or submission.is_self:
if (getattr(submission, 'link_flair_text', False) and any(f in submission.link_flair_text.lower() for f in ['meme', 'news'])) or submission.is_self:
print("Either this is flaired Meme or this is a self-post.")
return

Expand Down

0 comments on commit d07fe28

Please sign in to comment.