aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-09-17 20:32:35 -0700
committerFuwn <[email protected]>2025-09-17 20:32:35 -0700
commit1a7811bdc7db148193d78264e1f98f6bc954701b (patch)
tree3079d2405b31a7c358e1d08d44a47b585d639339 /src
parentfeat(intelligent_moderator): Update low-effort removal user message (diff)
downloadumabot-1a7811bdc7db148193d78264e1f98f6bc954701b.tar.xz
umabot-1a7811bdc7db148193d78264e1f98f6bc954701b.zip
revert: "feat(intelligent_moderator): Update low-effort removal user message"
This reverts commit dc542be70e0fbdbba3574b6d3297fa0baff33488.
Diffstat (limited to 'src')
-rw-r--r--src/umabot/rules/intelligent_roleplay_moderator.py29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/umabot/rules/intelligent_roleplay_moderator.py b/src/umabot/rules/intelligent_roleplay_moderator.py
index 2173e34..a81ea88 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 comment on it
- self._comment_low_effort_removal(submission, evaluation)
+ # Remove low-effort post and notify user
+ self._notify_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 comment instead of using removal message
+ return "" # We send mod mail instead of commenting
# Abstract method implementations for IntelligentModeratorBase
def _get_submission_id(self, submission: praw.models.Submission) -> str:
@@ -132,19 +132,26 @@ Thank you for understanding!"""
except Exception as e:
self.logger.error(f"Error sending art flair notification for {submission.id}: {e}")
- def _comment_low_effort_removal(self, submission: praw.models.Submission, evaluation: dict) -> None:
- """Comment on low-effort removal."""
+ def _notify_low_effort_removal(self, submission: praw.models.Submission, evaluation: dict) -> None:
+ """Send mod mail about 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)
- comment_text = """Your roleplay post has been removed because it was determined to be low-effort content."""
+ message = f"""Hello u/{username},
+
+Your roleplay post has been removed because it was determined to be low-effort content."""
# Add reasoning if configured
if formatted_reasoning:
- comment_text += f"\n\nReasoning: {formatted_reasoning}"
+ message += f"\n\nReasoning: {formatted_reasoning}"
- comment_text += f"""
+ message += f"""
+
+Post link: https://reddit.com{submission.permalink}
To improve your roleplay posts, consider:
- Adding more detailed descriptions
@@ -158,11 +165,11 @@ If you believe this was done in error, please contact the moderators via Mod Mai
Thank you for understanding!"""
- submission.reply(comment_text)
- self.logger.info(f"Commented on low-effort removal for post {submission.id}")
+ submission.author.message(subject, message)
+ self.logger.info(f"Sent low-effort removal notification to {username}")
except Exception as e:
- self.logger.error(f"Error commenting on low-effort removal for {submission.id}: {e}")
+ self.logger.error(f"Error sending low-effort notification 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."""