From 4d4cfdcd9826a31625a434fdfc5cd17a2f61d328 Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 6 Jun 2022 18:19:55 -0400 Subject: [PATCH] stickied comments will never be used again see https://github.com/elebumm/RedditVideoMakerBot/pull/290 --- reddit/subreddit.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reddit/subreddit.py b/reddit/subreddit.py index b6947d8..30ff8bd 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -65,10 +65,11 @@ def get_subreddit_threads(): content["comments"] = [] for top_level_comment in submission.comments: - if len(top_level_comment.body) <= int(environ["MAX_COMMENT_LENGTH"]): - content["comments"].append( - {"comment_body": top_level_comment.body, "comment_url": top_level_comment.permalink, - "comment_id": top_level_comment.id, }) + if not top_level_comment.stickied: + if len(top_level_comment.body) <= int(environ["MAX_COMMENT_LENGTH"]): + content["comments"].append( + {"comment_body": top_level_comment.body, "comment_url": top_level_comment.permalink, + "comment_id": top_level_comment.id, }) except AttributeError as e: pass print_substep("Received subreddit threads Successfully.", style="bold green")