Guide6 min read

How Telegram spam filtering works

What a group moderation bot can see, what it can act on, and where the honest limits are.

By TG Filter Team

What the bot actually receives

Telegram delivers updates to a bot over a webhook (or long polling). In groups, a bot in privacy mode only gets commands and replies addressed to it. To read ordinary messages it must either be an administrator or have privacy disabled in BotFather. This matters more than any model choice: no visibility, no filtering.

Updates arrive as JSON. The moderation-relevant fields are message.text, message.chat.id (the group) and message.message_id (what you would delete). Media without a caption has no text, so a text filter acknowledges those and moves on.

The two costs are not symmetric

A missed spam message costs the group one annoying message and one manual delete. A false deletion costs trust, and usually the bot: admins uninstall a filter that eats real messages within days. That asymmetry is why a good filter is precision-first, and why the ambiguous middle is judged rather than deleted.

The three-band verdict

bandmeaningaction
Allownothing suspiciousleave it alone
Reviewsome evidence, not enoughjudge it (or log it), never delete blind
Deleteconvictedremove the message

The bands come from an additive score over independent evidence: phrase signatures, URL reputation, obfuscation signals, campaign history. The thresholds are configurable per deployment because different communities want different trade-offs.

What to check before trusting a filter

  • Does it explain a deletion? (reason codes, not just a verdict)
  • Does it expose its false-positive rate on real corpora?
  • Does it fail open (review) when its model is unavailable?
  • Can a human override a verdict, and is that recorded?
  • Does it need admin rights it doesn't use?