StopSpam

A Telegram bot that deletes spam and scam in groups, using calibrated classifier confidence.

  • javascript
  • telegram
  • serverless
  • classification
Status
live
Main language
JavaScript
Last commit
October 8, 2026
StopSpam preview

StopSpam is a Telegram bot that removes spam and scam messages from group chats. Insults, off-topic chatter and house rules stay with the human admins.

What it does

  • Checks every message from new or previously flagged members; regulars stop being checked after 5 clean messages.
  • Re-checks anyone who posts a link, an invite or a forward, or returns after 30 days of silence.
  • Spends its first 7 days in a group in observation mode, deleting nothing until an admin switches it on.
  • Sends uncertain cases as review cards to an admin’s DMs or a moderator group, never to the group itself.
  • Is free for groups up to 200 members; larger groups pay in Telegram Stars for automatic deletion and still get review cards without it.

Deleting only on confident calls

Each checked message goes to TypeSafe’s Jev API, which returns spam, scam, severity and “reads like an ordinary member” answers, each with a calibrated confidence. A pure function in policy.js combines them into one risk score. Automatic deletion needs four things at once: risk of at least 0.90, severity of at least 1, severity confidence of at least 0.75, and a member-likeness score no higher than 0.30. A message with risk of 0.55 or more that misses any of these goes to a human as a review card. Admins are never acted on.

These thresholds were set by judgment, not measured against a labelled dataset, and the README says so. Payment does not change them: every tier gets the same classifier and the same cutoffs.

The bot runs on Telegram Serverless as plain JavaScript with a platform-hosted SQLite database, ported from a Python version in October 2026.

← all projects