Skip to content

feat: block media during new user probation#8

Merged
rezhajulio merged 1 commit intomainfrom
feat/block-media-probation
Mar 16, 2026
Merged

feat: block media during new user probation#8
rezhajulio merged 1 commit intomainfrom
feat/block-media-probation

Conversation

@rezhajulio
Copy link
Owner

Summary

Block media attachments (photo, video, animation, audio, voice, video note) for new users during their probation period. Documents and stickers are allowed.

Changes

  • anti_spam.py: Add has_media() helper and integrate into handle_new_user_spam violation checks
  • constants.py: Update Indonesian warning/restriction templates to reflect media blocking
  • test_anti_spam.py: Add unit tests for all media types + handler-level integration tests (547 tests, 99% coverage)

Add media detection (photo, video, animation, audio, voice, video note)
to anti-spam probation enforcement. New users in probation period are now
restricted from sending media attachments alongside existing restrictions
on forwarded messages, links, and external replies.

- Add has_media() helper to detect media attachments
- Integrate media check into handle_new_user_spam handler
- Update Indonesian warning/restriction templates
- Add unit and handler-level tests for all media types
@rezhajulio rezhajulio merged commit 9448844 into main Mar 16, 2026
5 checks passed
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.

1 participant