diff options
| author | Fuwn <[email protected]> | 2025-09-17 20:20:50 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-09-17 20:20:50 -0700 |
| commit | dc542be70e0fbdbba3574b6d3297fa0baff33488 (patch) | |
| tree | afa10befa1b267df0f7425b4a5bd99d67e99fdac | |
| parent | feat(intelligent_moderator): Update response grammar (diff) | |
| download | umabot-dc542be70e0fbdbba3574b6d3297fa0baff33488.tar.xz umabot-dc542be70e0fbdbba3574b6d3297fa0baff33488.zip | |
feat(intelligent_moderator): Update low-effort removal user message
| -rw-r--r-- | TEST_MODERATOR_README.md | 27 | ||||
| -rw-r--r-- | src/umabot/rules/intelligent_roleplay_moderator.py | 29 | ||||
| -rwxr-xr-x | test_moderator.py | 5 |
3 files changed, 32 insertions, 29 deletions
diff --git a/TEST_MODERATOR_README.md b/TEST_MODERATOR_README.md index bfde61f..adbdab6 100644 --- a/TEST_MODERATOR_README.md +++ b/TEST_MODERATOR_README.md @@ -82,17 +82,16 @@ The tool shows: ### Actions -- **šØ Change flair to Art**: Post will be re-flaired and user notified -- **šļø Remove post (low-effort)**: Post will be removed and user notified +- **šØ 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 - **ā
Allow post**: Post passes all checks and will be allowed -### Mod Mail Preview +### Communication Preview -The tool shows exactly what mod mail messages would be sent to users, including: +The tool shows exactly what communication would be sent to users: -- Subject lines -- Message content -- Reasoning explanations +- **Mod Mail**: For art flair changes (subject lines, message content, reasoning explanations) +- **Comments**: For low-effort removals (comment text, reasoning explanations) ## Example Output @@ -117,7 +116,18 @@ 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. - Reasoning: This post is primarily showcasing artwork with detailed description of the art process, making it more suitable for the Art flair 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 + ``` ## Setup @@ -151,3 +161,4 @@ 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 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.""" diff --git a/test_moderator.py b/test_moderator.py index 939d214..f2036e1 100755 --- a/test_moderator.py +++ b/test_moderator.py @@ -398,9 +398,8 @@ def print_results(results: List[Dict[str, Any]], pause: bool = False, moderator: pass if "REMOVE_POST" in actions: - 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.") + 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.") # Format reasoning based on moderator's reasoning level if moderator: |