aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-09-19 14:34:57 -0700
committerFuwn <[email protected]>2025-09-19 14:34:57 -0700
commit0757f273c21c9aab3d712b1d66d17490cec04d44 (patch)
tree17b20848b2af5ab1a681621d13cc4a29359a2d95
parentfix(irm): Send Mod Mail to author (diff)
downloadumabot-0757f273c21c9aab3d712b1d66d17490cec04d44.tar.xz
umabot-0757f273c21c9aab3d712b1d66d17490cec04d44.zip
fix(irm): Missing media attribute handling
-rw-r--r--src/umabot/rules/intelligent_roleplay_moderator.py15
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."""