aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/umabot/rules/intelligent_roleplay_moderator.py29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/umabot/rules/intelligent_roleplay_moderator.py b/src/umabot/rules/intelligent_roleplay_moderator.py
index a81ea88..2173e34 100644
--- a/src/umabot/rules/intelligent_roleplay_moderator.py
+++ b/src/umabot/rules/intelligent_roleplay_moderator.py
@@ -34,8 +34,8 @@ class IntelligentRoleplayModerator(Rule, IntelligentModeratorBase):
return False # Don't remove, just change flair
elif evaluation["is_low_effort"]:
- # Remove low-effort post and notify user
- self._notify_low_effort_removal(submission, evaluation)
+ # Remove low-effort post and comment on it
+ self._comment_low_effort_removal(submission, evaluation)
return True # Remove the post
# Post is good quality roleplay - allow it
@@ -47,7 +47,7 @@ class IntelligentRoleplayModerator(Rule, IntelligentModeratorBase):
def get_removal_message(self, submission: praw.models.Submission) -> str:
"""Get removal message for low-effort posts."""
- return "" # We send mod mail instead of commenting
+ return "" # We comment instead of using removal message
# Abstract method implementations for IntelligentModeratorBase
def _get_submission_id(self, submission: praw.models.Submission) -> str:
@@ -132,26 +132,19 @@ Thank you for understanding!"""
except Exception as e:
self.logger.error(f"Error sending art flair notification for {submission.id}: {e}")
- def _notify_low_effort_removal(self, submission: praw.models.Submission, evaluation: dict) -> None:
- """Send mod mail about low-effort removal."""
+ def _comment_low_effort_removal(self, submission: praw.models.Submission, evaluation: dict) -> None:
+ """Comment on low-effort removal."""
try:
- username = submission.author.name
- subject = "Your roleplay post has been removed for low-effort"
-
# Format reasoning based on configuration
formatted_reasoning = self._format_reasoning(evaluation)
- message = f"""Hello u/{username},
-
-Your roleplay post has been removed because it was determined to be low-effort content."""
+ comment_text = """Your roleplay post has been removed because it was determined to be low-effort content."""
# Add reasoning if configured
if formatted_reasoning:
- message += f"\n\nReasoning: {formatted_reasoning}"
+ comment_text += f"\n\nReasoning: {formatted_reasoning}"
- message += f"""
-
-Post link: https://reddit.com{submission.permalink}
+ comment_text += f"""
To improve your roleplay posts, consider:
- Adding more detailed descriptions
@@ -165,11 +158,11 @@ If you believe this was done in error, please contact the moderators via Mod Mai
Thank you for understanding!"""
- submission.author.message(subject, message)
- self.logger.info(f"Sent low-effort removal notification to {username}")
+ submission.reply(comment_text)
+ self.logger.info(f"Commented on low-effort removal for post {submission.id}")
except Exception as e:
- self.logger.error(f"Error sending low-effort notification for {submission.id}: {e}")
+ self.logger.error(f"Error commenting on low-effort removal for {submission.id}: {e}")
def _format_reasoning(self, evaluation: dict, is_art_flair_change: bool = False) -> str:
"""Format reasoning based on the configured reasoning level."""