Skip to content

tg-spam

Self-hosted Telegram anti-spam bot that deletes spam and bans senders in your groups

Permissive (OSI) · MIT

Listed by , founder & editor

81

Health

Thriving

Overview

Stars

460

Last commit

5 days ago

Nov 2026

Repository age

3 years

since Nov 2023

Latest version

v1.29.1

Oct 2026

Contributors

–

5 active in 90 days

Releases

16

last 12 months

Docker pulls

57k

umputun/tg-spam

Language

Go

TG-Spam is a bot for Telegram groups that watches incoming messages, deletes the ones it flags as spam and bans the sender. You run it yourself, usually as a Docker container, and it needs a Telegram token and a group name or ID to start. It is written in Go.

Detection combines several checks: similarity to known spam, a stop word list, an emoji count, link and image rules, and a lookup of the user in the Combot Anti-Spam System. You can also add OpenAI or Google Gemini models, alone or together, and write your own checks as Lua plugins. The bot learns from corrections made by human admins.

It can also run as a server with an HTTP API, so tools unrelated to Telegram can check text for spam. A web UI covers admin tasks, and the detection modules work as a Go library. The Docker image supports amd64, arm64 and armv7, so it runs on a small VPS or a Raspberry Pi. Binaries exist for Linux, macOS and Windows. It is MIT licensed and has no specific commercial product it replaces.

Who it's for

Admins of large public Telegram groups

It removes spam and bans repeat senders automatically, so moderators handle fewer manual deletions.

Skip if: Your group is small and a built-in moderation setting already keeps spam out.

Self-hosters running small servers or a Raspberry Pi

The Docker image supports arm64 and armv7, and the bot runs on modest hardware.

Skip if: You do not want to run and update a container yourself.

Developers who need a spam check API

The HTTP server mode and Go library let you reuse the detection outside Telegram.

Skip if: You need a hosted service with a support contract.

The problem it solves

Telegram groups attract spam accounts that post junk links and ads faster than moderators can remove them. This bot detects and removes that content automatically, and bans the accounts behind it, without sending your messages to a hosted moderation service.

Strengths

  • Combines similarity, stop words, emoji, link and image checks with Combot CAS lookups
  • Optional OpenAI and Gemini analysis, usable together
  • Custom Lua plugins add detection rules without changing the code
  • Docker images for amd64, arm64 and armv7, plus binaries for Linux, macOS and Windows
  • Also offers an HTTP API, a web UI and a Go library

Trade-offs

  • Only works with Telegram
  • LLM checks need an OpenAI or Gemini account and send message text to those services
  • You host, configure and update it yourself

Self-host tg-spam

Self-hostable
Yes
Docker image
umputun/tg-spam

Frequently asked questions

Is TG-Spam free?

Yes. It is released under the MIT license and you run it on your own hardware.

Can I self-host it?

Yes. Self-hosting is the intended use, mainly through the Docker image at umputun/tg-spam or ghcr.io/umputun/tg-spam.

Which platforms does it run on?

The Docker image supports amd64, arm64 and armv7. Binaries are available for Linux, macOS and Windows.

Do I need an AI service?

No. OpenAI and Google Gemini checks are optional additions to the built-in detection.

Similar tools in Threat detection and monitoring

Zoneminder

Threat detection and monitoring

6k 1.3k today Active GPL-2.0

ossec-hids

Threat detection and monitoring

5.1k 1.1k 4 days ago Active GPL-2.0

motion

Threat detection and monitoring

4.1k 565 5 days ago Active GPL-3.0

Viseron

Threat detection and monitoring

3.7k 466 today Thriving MIT

clearcam

Threat detection and monitoring

2.8k 274 today Active GPL-3.0