aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--TEST_MODERATOR_README.md27
-rw-r--r--src/umabot/rules/intelligent_roleplay_moderator.py29
-rwxr-xr-xtest_moderator.py5
3 files changed, 29 insertions, 32 deletions
diff --git a/TEST_MODERATOR_README.md b/TEST_MODERATOR_README.md
index adbdab6..bfde61f 100644
--- a/TEST_MODERATOR_README.md
+++ b/TEST_MODERATOR_README.md
@@ -82,16 +82,17 @@ The tool shows:
### Actions
-- **šŸŽØ Change flair to Art**: Post will be re-flaired and user notified via mod mail
-- **šŸ—‘ļø Remove post (low-effort)**: Post will be removed and user notified via comment
+- **šŸŽØ Change flair to Art**: Post will be re-flaired and user notified
+- **šŸ—‘ļø Remove post (low-effort)**: Post will be removed and user notified
- **āœ… Allow post**: Post passes all checks and will be allowed
-### Communication Preview
+### Mod Mail Preview
-The tool shows exactly what communication would be sent to users:
+The tool shows exactly what mod mail messages would be sent to users, including:
-- **Mod Mail**: For art flair changes (subject lines, message content, reasoning explanations)
-- **Comments**: For low-effort removals (comment text, reasoning explanations)
+- Subject lines
+- Message content
+- Reasoning explanations
## Example Output
@@ -116,18 +117,7 @@ Content Preview: Check out this amazing artwork I drew of Tokai Teio! She's so b
šŸ“§ Mod Mail (Art Flair Change):
Subject: Your post flair has been changed to Art
Message: Your roleplay post has been automatically re-flaired as 'Art' because it appears to be primarily showcasing artwork or visual content rather than roleplay.
-
-**Low-Effort Removal Example:**
-```
-
-šŸ“‹ Actions:
-šŸ—‘ļø Remove post (low-effort)
-
-šŸ’¬ Comment (Low Effort Removal):
-Comment: Your roleplay post has been removed because it was determined to be low-effort content.
-Reasoning: short, low-effort
-Discord Recommendation: If you enjoy active roleplay, join the official r/okbuddyumamusume Discord server! It features a comprehensive layout of channels, forums, roles, bots, events, and more! https://discord.gg/okbuddyumamusume
-
+ Reasoning: This post is primarily showcasing artwork with detailed description of the art process, making it more suitable for the Art flair than Roleplay.
```
## Setup
@@ -161,4 +151,3 @@ If you encounter issues:
2. Verify your OpenAI API key is working
3. Ensure test files are valid text files
4. Check the error messages for specific guidance
-```
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."""
diff --git a/test_moderator.py b/test_moderator.py
index f2036e1..939d214 100755
--- a/test_moderator.py
+++ b/test_moderator.py
@@ -398,8 +398,9 @@ def print_results(results: List[Dict[str, Any]], pause: bool = False, moderator:
pass
if "REMOVE_POST" in actions:
- print(f"\nšŸ’¬ Comment (Low Effort Removal):")
- print(f" Comment: Your roleplay post has been removed because it was determined to be low-effort content.")
+ print(f"\nšŸ“§ Mod Mail (Low Effort Removal):")
+ print(f" Subject: Your roleplay post has been removed for low-effort")
+ print(f" Message: Your roleplay post has been removed because it was determined to be low-effort content.")
# Format reasoning based on moderator's reasoning level
if moderator: