Back to articles
Building a Fairer Anti-Spam System: How We Handle Links, Warnings, and New Chats

Building a Fairer Anti-Spam System: How We Handle Links, Warnings, and New Chats

via Dev.to WebdevPersonymAi

just shipped three changes to our Telegram anti-spam bot (ModerAI) that fundamentally change how we handle edge cases. Here's what we built and why. The Problem With Binary Decisions Most anti-spam bots make binary decisions: spam or not spam. Ban or allow. This creates two failure modes: False positives — legitimate users banned for having a link in their bio False negatives — spammers who learn the rules and work around them We needed a middle ground. Change 1: Contextual Bio Link Analysis Before: if "t.me/" in user.bio: ban(user) # crude but effective... and unfair After: link_target = analyze_link_context(user.bio) if link_target.category in ["spam_channel", "scam", "adult"]: ban(user) elif link_target.category in ["game_referral", "personal_channel", "community"]: allow(user) # legitimate use case AI analyzes what the link actually points to. A Hamster Kombat referral? Fine. A channel selling "guaranteed 500% returns"? Ban. Change 2: Progressive Warning System Instead of ban-on-fi

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
2 views

Related Articles