Loading repository data…
Loading repository data…
RakinSV / repository
Telegram content pipeline: Telethon parsing → LLM rewrite → moderation → auto-publish, plus Guardian — an independent AI-powered group moderation bot (captcha, spam filter, anti-raid). FastAPI web admin, Docker, full CI.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
╔══════════════════════════════════════════════════════════════════╗
║ ║
║ ████████╗ ██████╗ ██████╗ ███████╗██████╗ ██████╗ ███████╗║
║ ╚══██╔══╝██╔════╝ ██╔══██╗██╔════╝██╔══██╗██╔═══██╗██╔════╝║
║ ██║ ██║ ███╗ ██████╔╝█████╗ ██████╔╝██║ ██║███████╗║
║ ██║ ██║ ██║ ██╔══██╗██╔══╝ ██╔═══╝ ██║ ██║╚════██║║
║ ██║ ╚██████╔╝ ██║ ██║███████╗██║ ╚██████╔╝███████║║
║ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═════╝ ╚══════╝║
║ ║
║ + G U A R D I A N · AI group-chat moderation ║
╚══════════════════════════════════════════════════════════════════╝
An automated Telegram content pipeline: scrape → LLM rewrite → moderate → publish — plus a standalone AI moderator bot for your group chat. Two independent bots, one web admin panel, all self-hosted.
🇬🇧 English | 🇷🇺 Русский | 📖 Wiki (full docs, FAQ, troubleshooting)
A Telegram channel owner usually picks between two bad options: manually rewrite other people's posts every day, or just forward them and risk plagiarism complaints and audience loss. This project automates the whole path from source post to publication — LLM rewriting, duplicate detection, pre-publish moderation, and stats on what actually resonates with your audience. A separate bot protects the group at the same time, so the audience the first bot grows doesn't get drowned by spam, bots, and raids.
Both bots are production-ready: Alembic migrations from day one, 537 tests,
CI running lint/type-check/security-scan on every push, Docker packaging for
VPS/Proxmox deployment, and a single web admin panel instead of poking at
.env files and a database by hand.
This README is the overview and quick start. For a beginner-friendly, step-by-step deployment walkthrough with FAQ and troubleshooting, see the Wiki — if you've never run a Docker container before, start there, not here. For deep implementation-level context and architecture decisions (written for contributors/maintainers, not end users), see CLAUDE.md, the repost bot's feature backlog in FEATURES.md, the phased implementation plan in IMPLEMENTATION_PLAN.md, and Guardian's own docs in guardian/GUARDIAN.md and guardian/GUARDIAN_FEATURES.md (these four are in Russian).
┌─────────────────────────────── Repost bot ────────────────────────────────┐
│ │
│ N Telegram channels │
│ │ Telethon (user session, reads without Bot API limits) │
│ ▼ │
│ keyword filter → hash dedup → semantic dedup check (embeddings) │
│ │ │
│ ▼ │
│ LLM rewrite (style profile per post type) + source enrichment (Brave) │
│ + RU/EN version comparison + auto cover image (Unsplash/ComfyUI) │
│ │ │
│ ▼ │
│ manual moderation via DM (✅/❌/✏️) OR scheduled auto-posting │
│ │ │
│ ▼ │
│ publish to N groups → collect stats → auto-digest / native ads / │
│ smart scheduling / growth tracker │
└─────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────── Guardian ──────────────────────────────────┐
│ │
│ New member → CAPTCHA (math/button/question) → muted until answered → │
│ welcome message with rules / auto-kick on timeout │
│ │
│ Every message → anti-flood → link whitelist → stop words → │
│ suspicion heuristics → AI classifier │
│ (only for the suspicious ~20% — saves tokens) │
│ │
│ Violations → escalating warns (mute → kick → ban) → log channel │
│ Join spike → anti-raid (chat lockdown) → auto-unlock │
│ 30 clean days → auto-trust (bypasses filters) │
└─────────────────────────────────────────────────────────────────────────┘
Both processes live in one repository but are independent bots — their
own tokens, their own databases (tg_repost.db / guardian.db), their own
Alembic migration chains. One crashing or being redeployed doesn't touch the
other. Both are managed from a single web panel.
Source.target_chat_ids), not a blanket "everything to every group".new → filtered_out | duplicate → rewriting → rewritten → pending_approval → approved | rejected → posted | failed, every transition logged.A separate bot on aiogram. Its job isn't to review content — it's to
protect the real people in your group from spam, bots, and toxicity
while your audience grows.
user_id addressing
rather than aiogram FSM context (a real security bug found and fixed —
see commit history).| Mode | How it works | When to use it |
|---|---|---|
keywords | Stop-word list with anti-evasion normalization (homoglyphs, zero-width characters, separators) | Zero cost, for small/quiet groups |
ai | Every message is classified via an OpenAI-compatible API, JSON response with a confidence score | Best quality, but spends tokens on every message |
hybrid | Heuristics (prices, "DM me", zero-width chars, forwards, brand-new accounts) select ~20% as suspicious → only those go to the AI | Recommended — AI-level quality at keyword-filter cost |
The AI classifier is fail-open: any error, timeout, or invalid JSON is treated as "let it through", never as "delete" — when unsure, the bot never cuts a legitimate message.
text_link entities).