Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 14, 2025

Summary

This PR implements a rating system for censored words usage as requested in issue #13:

  • +1 point for each message without censored words
  • -1 point for each censored word found in messages

Implementation Details

  • Censored words list: Added comprehensive list of Russian and English profanity in config.py
  • User rating tracking: Added censored_words_rating property to user data model
  • Message processing: All messages (commands and regular text) are processed for censored words
  • Rating command: Users can check their rating with рейтинг/rating/цензура/censored commands
  • Word boundary detection: Uses regex word boundaries to avoid false matches in partial words

Files Changed

  • config.py: Added CENSORED_WORDS list
  • modules/data_service.py: Added censored_words_rating pattern to user model
  • modules/commands.py: Added rating processing and display logic
  • patterns.py: Added pattern for rating command
  • __main__.py: Registered rating command
  • tests.py: Added comprehensive tests

Test Plan

  • Clean messages get +1 rating
  • Messages with censored words get -1 per word
  • Rating display command works correctly
  • Word boundary detection prevents false positives
  • All existing functionality remains intact

🤖 Generated with Claude Code


Resolves #13

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #13
@konard konard self-assigned this Sep 14, 2025
- Add CENSORED_WORDS list in config.py with Russian and English profanity
- Add censored_words_rating property to user data model
- Implement process_censored_words_rating() method with logic:
  * +1 for clean messages (no censored words)
  * -1 for each censored word found
- Add 'рейтинг'/'rating' command to display user's censored words rating
- Process all messages (commands and regular messages) for rating
- Add comprehensive tests for the new functionality
- Use regex word boundaries to avoid partial matches

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@konard konard changed the title [WIP] Rating of censored words usage Implement rating of censored words usage Sep 14, 2025
@konard konard marked this pull request as ready for review September 14, 2025 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rating of censored words usage

2 participants