explaingit

anvarnarz/killspam-bot

Analysis updated 2026-05-18

35PythonAudience · ops devopsComplexity · 3/5LicenseSetup · moderate

TLDR

A self serve Telegram moderation bot that removes explicit content, malware links, and coordinated spam attacks, per group and non-commercial.

Mindmap

mindmap
  root((Killspam Bot))
    What it does
      Scans new member profiles
      Blocks malware links
      Detects coordinated spam
      AI flags explicit content
    Tech stack
      Python
      PostgreSQL
      NudeNet
      Gemini API
    Use cases
      Protect a study community group
      Auto-ban spam bot swarms
      Screen new member profile photos
    Audience
      Community moderators
      Group admins

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add the bot to a Telegram group and enable it to auto-remove explicit or spam content.

USE CASE 2

Let each group supply its own Gemini API key so AI moderation costs stay separate per group.

USE CASE 3

Automatically detect and remove coordinated spam attacks hitting a group from multiple accounts.

USE CASE 4

Screen new members' profile pictures locally for explicit images before they can post.

What is it built with?

PythonPostgreSQLNudeNetGemini APIRailway

How does it compare?

anvarnarz/killspam-botalex-nlp/denoiserlblueberriely/ai-social-browser
Stars353535
LanguagePythonPythonPython
Setup difficultymoderatehardhard
Complexity3/55/54/5
Audienceops devopsresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Requires a PostgreSQL database, a public HTTPS URL, and disabling the bot's Telegram privacy mode via BotFather.

Free to use and modify for non-commercial purposes only, under the PolyForm Noncommercial license.

In plain English

Killspam Bot is a self serve moderation bot for Telegram groups, built with study and IT communities in mind. Anyone can add it to their group, run one enable command, and it starts protecting the group right away. It serves many separate groups at once, and each group brings its own Google Gemini API key for the AI checks, so there is no shared cost and no shared key to leak. Even without a key, a free rule based layer keeps working on its own. The bot checks new members when they join and when they send their first message. It looks at profile pictures and descriptions for explicit content using a model called NudeNet that runs locally on the server rather than sending images to any outside service. It also blocks download links to files like APK or EXE installers and links to explicit channels, treating those as serious violations handled before any other check. An optional AI layer using Gemini can flag suspicious messages as explicit or flirtatious spam, while trying not to touch normal conversation, ads, or off topic chatter. A separate detector watches for coordinated attacks, where the same message arrives from several accounts within a couple of minutes, and removes them all at once. Responses are tiered by severity. Clear serious violations lead to an immediate ban and message deletion. Less certain cases lead to a 24 hour mute plus a review prompt sent to the group's admins, who can ban the account or restore its voice with a button in that alert. Admins also have commands to ban or mute manually, teach the bot new keywords, and flag misclassifications. The bot reports its own token usage and group statistics through commands, and sends a daily summary to its operator. Each group's Gemini key is encrypted at rest, and stored spam reports and usage logs are cleared out after 90 days. To run it yourself, you create a Telegram bot through BotFather, disable its privacy mode so it can read group messages, clone the repository, install its Python dependencies, and fill in required environment variables including a bot token, a PostgreSQL database URL, an encryption secret, and a public HTTPS address. It is built to deploy on Railway but works on any host that supports a Python worker plus PostgreSQL. The project is licensed under PolyForm Noncommercial 1.0.0, which restricts it to non-commercial use.

Copy-paste prompts

Prompt 1
Walk me through deploying Killspam Bot on Railway with PostgreSQL.
Prompt 2
Explain how Killspam Bot's tiered response system decides between mute and ban.
Prompt 3
What environment variables does Killspam Bot require before it will start?
Prompt 4
How does Killspam Bot detect a coordinated spam attack from multiple accounts?
Prompt 5
Show me how to set up BYOK Gemini moderation for my Telegram group with /setkey.

Frequently asked questions

What is killspam-bot?

A self serve Telegram moderation bot that removes explicit content, malware links, and coordinated spam attacks, per group and non-commercial.

What language is killspam-bot written in?

Mainly Python. The stack also includes Python, PostgreSQL, NudeNet.

What license does killspam-bot use?

Free to use and modify for non-commercial purposes only, under the PolyForm Noncommercial license.

How hard is killspam-bot to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is killspam-bot for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.