A Telegram automation platform that ingests media from source channels and direct bot submissions, processes it (watermarking, deduplication, metadata), and routes it through moderation flows before publishing to destination channels. The app includes a Python backend, a React SPA admin dashboard, and background scheduling/analytics utilities.
The application is split into clear runtime layers:
- Ingestion layer
telegram_auto_poster/client/client.pyuses Telethon to monitor source channels and download candidate media.telegram_auto_poster/bot/handlers.pyaccepts user submissions throughpython-telegram-bot.
- Processing layer
telegram_auto_poster/media/photo.pyandtelegram_auto_poster/media/video.pyapply watermarks and transformations.telegram_auto_poster/utils/deduplication.py,caption.py, and related helpers normalize posts before review.
- Moderation & publishing layer
telegram_auto_poster/web/app.pyexposes API endpoints consumed by the SPA for queue review, scheduling, trash/restore, events, settings, and stats.- Moderation actions move objects between storage prefixes (
processed,scheduled,posted,trash) and can trigger immediate posting or scheduled publishing.
- Storage and state layer
- MinIO stores media binaries and metadata sidecars.
- Valkey-backed utilities in
telegram_auto_poster/utils/stats.pyand related modules store counters, leaderboard data, and event snapshots.
- Frontend layer
frontend/is a Vite + React + TypeScript SPA with route-based pages for suggestions, queue, batch, posts, trash, stats, leaderboard, jobs, and settings.- Built assets are served by FastAPI from
frontend/dist.
Follow these steps to get running fast. For expanded docs, see the Wiki.
- Clone and init submodules
git clone https://github.com/ooodnakov/telegram_meme_autoposter.git cd telegram_meme_autoposter git submodule update --init --recursive - Install dependencies (Python 3.12 + uv)
And install the dashboard dependencies:
uv sync
cd frontend npm install cd ..
- Create config and env files
cp config.example.ini config.ini cp .env.example .env
- Fill in credentials and endpoints
- Telegram Bot token and API ID/Hash
- MinIO endpoint, access/secret keys, bucket
- Valkey host/port
- Target channel and admin IDs in
config.ini
- Run the app
Build the dashboard bundle and run bot + dashboard together:
uv run python -m telegram_auto_poster.main
cd frontend && npm run build && cd .. ./run_bg.sh
config.ini controls most behaviour. In addition to credentials, you can now:
- Configure attribution strings and the default suggestion caption under
[Branding]. - Change watermark assets, relative size, and transparency for images via
[WatermarkImage]. - Tune video watermark path, size range, and animation speed in
[WatermarkVideo].
Every option can also be overridden with environment variables (e.g. BRANDING_ATTRIBUTION,
WATERMARK_IMAGE_PATH).
- Wiki (GitHub): https://github.com/ooodnakov/telegram_meme_autoposter/wiki
- Local copy (submodule):
wiki/Home.md
Key topics to start with:
- Setup and configuration (env +
config.ini) - Running locally vs Docker
- Admin workflow and permissions
- Watches multiple source channels (Telethon)
- Watermarks images and processes videos
- Admin approval queue with batch posting
- Feedback to submitters on approval/rejection
- Configurable trash bin for rejected posts with restore support
- Daily stats and Valkey-backed metrics
- React dashboard served by FastAPI for review/analytics
- MinIO-backed storage for originals/processed media
telegram_auto_poster/main.py: Async entrypoint orchestrating bot polling + channel watcher lifecycle.telegram_auto_poster/bot/: Bot runtime (bot.py) and command/callback/handler modules.telegram_auto_poster/client/: Telethon ingestion client for monitored channels.telegram_auto_poster/media/: Image/video processing pipelines.telegram_auto_poster/web/: FastAPI app providing auth, API endpoints, and static SPA serving.telegram_auto_poster/utils/: Shared services (storage, stats, scheduler, jobs, i18n, trash, analytics).frontend/: React admin dashboard source code and tests.test/: Python test suite for backend behavior.wiki/: Project Wiki content (submodule).
- Build the dashboard and run the backend shell:
cd frontend && npm run build && cd .. uv run uvicorn telegram_auto_poster.web.app:app --host 0.0.0.0 --port 8000
- Frontend development server:
cd frontend npm run dev - Built-in pydoc browser after start:
http://localhost:8000/pydoc/- Example:
http://localhost:8000/pydoc/telegram_auto_poster.utils.storage
- Example:
Localization files live in telegram_auto_poster/locales. To extract and compile after updating translations:
./scripts/i18n.shDefault language and per-user overrides are configured in config.ini under [I18n].
- Prepare env and config
cp config.example.ini config.ini cp .env.example .env
- Start services
docker-compose up -d --build
Dashboard: http://localhost:8000. Logs: docker-compose logs -f.
See the Wiki for full Docker notes and production tips.
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name
- Commit changes
git commit -m "feat: add your feature" - Push and open a PR
git push origin feature/your-feature-name
Before submitting, ensure style checks pass and tests are added when applicable.