VK → Telegram + MAX Autoposter
A service that mirrors VK group posts into Telegram and MAX automatically.
Problem
A community owner had to manually copy every VK post — text, photos and videos — into a Telegram channel and a MAX chat, losing time and missing posts.
Result
A self-hosted service that publishes new VK posts to Telegram and MAX within seconds, with deduplication and automatic retries.
Tech Stack
Overview
VK → Telegram + MAX Autoposter is a small, reliable backend service that watches a VK community wall and republishes each new post to a Telegram channel and a MAX chat. It handles text, photo albums, videos and links, and runs unattended on a VPS via Docker.
Problem
Cross-posting the same content to several social networks is exactly the kind of repetitive work people stop doing well. The client published to VK first, then re-uploaded everything by hand to Telegram and MAX. Posts arrived late, attachments got dropped, and some updates never made it across at all. Off-the-shelf bridges either didn’t support MAX or couldn’t be trusted with media.
Solution
The service subscribes to VK’s Callback API and reacts to the wall_post_new event the moment a post appears — no slow polling. Each post is normalized into text plus a set of attachments, then fanned out to Telegram and MAX through their respective Bot APIs. A SQLite layer records every post so nothing is published twice, and a partial status lets the service retry only the network that failed instead of duplicating the whole post.
Features
- VK Callback API mode (
wall_post_new) with a polling fallback viawall.get - Publishes text, photo albums, videos and links to Telegram and MAX
- SQLite deduplication with
partialstatus and automatic re-delivery on failure - Skips pinned posts and, on first run, optionally skips the existing backlog
- Structured logging (pino) and a
/healthendpoint for monitoring - Docker + docker-compose deployment with GitHub Actions CI/CD to a VPS
Development Process
The trickiest part was media: VK, Telegram and MAX each model attachments differently, and MAX needs files uploaded before a message can reference them. The service downloads media to a working directory, uploads it per platform, and retries transient attachment.not.ready responses. Region also mattered — Telegram’s Bot API isn’t reliably reachable from Russian VPS providers, so the deployment targets a VPS outside RF.
Results
- New VK posts appear in Telegram and MAX within seconds, hands-free
- Deduplication and per-network retries eliminated both misses and double-posts
- Fully containerized: a single
docker compose upbrings the service back on a fresh server - A client-facing Russian guide made the system operable by a non-technical owner
What Was Learned
Reliability in a small integration comes from the boring parts: idempotency, partial-failure handling and honest logging. Modeling each post as “publish to N targets, track each independently” turned a fragile mirror into a service that quietly does its job.