diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/umabot/rules/intelligent_roleplay_moderator.py | 15 |
1 files 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.""" |