From 592521026a91a57ec6e42757971e09ffece4d3e2 Mon Sep 17 00:00:00 2001 From: Slfhstd Date: Tue, 10 Mar 2026 23:48:39 +0000 Subject: [PATCH] V2.1.1 --- CHANGELOG.md | 11 +++++++++++ modreplybot.py | 8 ++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dee8ea..c49b3b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,13 @@ # Changelog + +## [2.1.1] - 2026-03-10 + +### Fixed +- Prevented AttributeError in modqueue watcher and tag_post_watcher by checking for 'link_flair_text' only on Submission objects. This avoids errors when processing Comment objects. + +### Changed +- Updated logic in modqueue watcher and tag_post_watcher to safely handle both Submission and Comment objects. + ## [2.1.0] - 2026-03-10 ### Changed @@ -15,6 +24,8 @@ - Added modqueue_watcher thread for independent modqueue processing. - Added debug print statements for modqueue post attributes and loop entry. + + --- ## [V2 release] diff --git a/modreplybot.py b/modreplybot.py index 93cb16d..7c8fe6e 100644 --- a/modreplybot.py +++ b/modreplybot.py @@ -249,7 +249,7 @@ class ModReplyBot: try: # Check new submissions for submission in self.subreddit.stream.submissions(skip_existing=True): - flair = (submission.link_flair_text or '').strip().lower() + flair = (getattr(submission, 'link_flair_text', '') or '').strip().lower() title = submission.title.strip() import re title_tags = re.findall(r'\[(.*?)\]', title) @@ -288,7 +288,11 @@ class ModReplyBot: modqueue_posts = list(self.subreddit.mod.modqueue(limit=100)) print(f"[MODQUEUE DEBUG] Fetched {len(modqueue_posts)} posts from modqueue.") for submission in modqueue_posts: - flair = (submission.link_flair_text or '').strip().lower() + # Only access link_flair_text if it's a Submission + if hasattr(submission, 'link_flair_text'): + flair = (submission.link_flair_text or '').strip().lower() + else: + flair = '' title = submission.title.strip() import re title_tags = re.findall(r'\[(.*?)\]', title)