
In simple English
Telegram groups often attract spam bots that post unwanted links and advertisements. This self-hosted bot watches every incoming message and deletes spam the second it appears. It can also ban the spammer permanently. You run it on your own server using a simple Docker container. It is free to run, though you can optionally connect paid AI models for extra protection.
What it is
TG-Spam is an anti-spam bot written in Go that runs inside Telegram groups and checks messages against multiple filters. It stores known spam patterns in an SQLite or PostgreSQL database and learns from human moderator actions.
What it is good for
Community builders and group owners who want to stop automated scams and crypto spam in Telegram without paying for commercial moderation services.
- Runs lightweight on a small server, a VPS, or a Raspberry Pi.
- Combines classic word matching with optional AI checks from OpenAI and Gemini.
- Includes a web interface for managing settings and reviewing banned users.
- Requires technical setup using a Docker container and a Telegram bot token.
- Mistakes by the bot can permanently ban legitimate users if thresholds are set too aggressively.
- Running optional AI models adds ongoing API costs.
manual moderation and commercial Telegram protection services
a Telegram bot token and a dedicated chat group
- Notifuse/notifuse2.2k stars
Self-hosted newsletters, automations and transactional email, built on a delivery service you supply.
- krayin/laravel-crm24k stars
A self-hosted record of customers, leads and sales, built on the Laravel PHP framework.
- nikoksr/notify3.9k stars
A Go library that sends the same message to many messaging services through one call.
docker run -d \ --name tg-spam \ -e TELEGRAM_TOKEN="your-bot-token" \ -e TELEGRAM_GROUP="your-group-id" \ -v /path/on/host:/srv/data \ umputun/tg-spam