From 0757f273c21c9aab3d712b1d66d17490cec04d44 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 19 Sep 2025 14:34:57 -0700 Subject: fix(irm): Missing media attribute handling --- src/umabot/rules/intelligent_roleplay_moderator.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/umabot/rules/intelligent_roleplay_moderator.py b/src/umabot/rules/intelligent_roleplay_moderator.py index d36daa2..96e0ed9 100644 --- a/src/umabot/rules/intelligent_roleplay_moderator.py +++ b/src/umabot/rules/intelligent_roleplay_moderator.py @@ -68,15 +68,24 @@ class IntelligentRoleplayModerator(Rule, IntelligentModeratorBase): def _is_video(self, submission: praw.models.Submission) -> bool: """Check if submission is a video.""" - return submission.is_video + try: + return getattr(submission, 'is_video', False) + except Exception: + return False def _is_self(self, submission: praw.models.Submission) -> bool: """Check if submission is a self post.""" - return submission.is_self + try: + return getattr(submission, 'is_self', False) + except Exception: + return False def _is_gallery(self, submission: praw.models.Submission) -> bool: """Check if submission is a gallery.""" - return submission.is_gallery + try: + return getattr(submission, 'is_gallery', False) + except Exception: + return False def _log_info(self, message: str) -> None: """Log info message.""" -- cgit v1.2.3