Implement extended spam detection research for premium users, bio invite links, and channel messages#12
Draft
Copilot wants to merge 2 commits into
Draft
Implement extended spam detection research for premium users, bio invite links, and channel messages#12Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Co-authored-by: insoln <11380274+insoln@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate advanced criteria for automatic spam detection
Implement extended spam detection research for premium users, bio invite links, and channel messages
Oct 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements comprehensive research into extended criteria for automatic spam detection as requested in issue #XX. The implementation provides three new detection mechanisms to enhance the existing antispam system.
New Detection Criteria
1. Bio Invite Link Detection 🟡 Partially Implemented
Automatically detects users with Telegram invite links in their profile descriptions:
t.me/joinchat/*,t.me/+*,telegram.me/joinchat/*,telegram.me/+*EXTENDED_BIO_INVITE_CHECK_ENABLED2. Channel Message Detection 🟢 Fully Implemented
Identifies messages sent on behalf of channels while respecting existing auto-forward logic:
sender_chat(channel posting)EXTENDED_CHANNEL_MESSAGE_CHECK_ENABLED3. Premium User Channel Analysis 🔴 Research Framework
Provides foundation for detecting premium users with suspicious linked channels:
EXTENDED_PREMIUM_CHANNEL_CHECK_ENABLED=falseTechnical Implementation
The new
ExtendedSpamDetectorclass integrates seamlessly with the existing spam detection workflow intelegram_messages.py. Extended checks run before OpenAI analysis for performance optimization and include comprehensive error handling.API Research Findings
Available through Telegram Bot API:
message.sender_chatfor channel detectiongetChat()for public users onlyRisk Assessment & Safety
All detection methods are individually configurable to allow gradual rollout and risk management.
Configuration Options
Security & Testing
Documentation
EXTENDED_SPAM_DETECTION.md.env.exampleThis implementation provides enhanced spam detection capabilities while maintaining system stability and respecting current API limitations. The modular design enables future enhancements as additional API access becomes available.
Original prompt
Fixes #11
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.