How Channel Monitor Works
Detailed explanation of the Channel Monitor flow, from source detection to publication.
Architecture
OmniGest runs two separate processes for Channel Monitor:
- bot-monitor — a lightweight container running Telethon with your secondary account. Batch-scrapes active source channels once per hour.
- bot-referidos — the main OmniGest process. Consumes the candidates produced by bot-monitor, generates DM previews, and handles button taps for publication.
The two processes communicate via a database table (monitor_candidates) — no direct coupling. If one crashes, the other keeps running.
Data flow per deal
Source channel publishes → bot-monitor detects on next scrape (≤1h) →
candidate saved to DB → bot-referidos poll (every 3s) picks it up →
URL converted to affiliate → official product image fetched + overlay →
DM sent to you with 4 buttons →
You tap a destination → published there with your tag
Sources
A source is a Telegram channel you want to watch. It must be public (you can subscribe with the secondary account if it's required).
Filters per source
Every source has a marketplace filter:
| Filter | Behaviour |
|---|---|
| 🛒 AliExpress only | Posts must contain an AliExpress URL. Amazon URLs in the same post are ignored. |
| 📦 Amazon only | Posts must contain an Amazon URL. AliExpress URLs in the same post are ignored. |
| 🔀 Both (default) | Any convertible URL triggers a candidate. |
If a post has no convertible URL after filtering, it is discarded silently.
First scrape
When you add a new source, the first scrape does not backfill history. It records the current latest message id and only emits candidates from the next message onwards. This prevents flooding your DM with 100 old posts.
Preview (DM)
Once a candidate is ready, you receive a DM with:
- Official product image from the marketplace (not the source channel's image). OmniGest fetches this via AliExpress API or Amazon's
og:image. A subtle@OmniGestwatermark is added in the bottom-right corner. - Caption —
[Source: @channelname]+ the original text with the URL replaced by your affiliate link. - 4 inline buttons:
[📢 Destination 1]— publish to your Slot 1 destination.[👥 Destination 2]— publish to your Slot 2 destination (if configured).[✏️ Edit]— rewrite the caption before publishing (5-min timeout).[🗑 Ignore]— discard the candidate.
Destinations (slots)
A destination is a fixed channel or group where OmniGest publishes when you tap a slot button.
- 2 slots on Free tier. Free users can pick two destinations — typically a public channel + a private "review" group.
- Each slot is configured via
/monitor_dest 1or/monitor_dest 2by forwarding a message from that chat. - The bot must be a member of each destination (verified at configuration time).
- If you tap both slots in the same preview, the deal is published to both (sequentially).
Publication content
When published, the caption is cleaned: the [Source: @channel] prefix is removed. Only the deal text + your affiliate URL + the watermarked product image go out.
Manual workflow, by design
Channel Monitor is fully manual. OmniGest never publishes without you tapping a button. This is deliberate:
- Avoids publishing low-quality deals, off-topic posts, or errors.
- Lets you curate for your audience (skip boring deals, push the great ones).
- Keeps you in control of your affiliate account's reputation.
If you want auto-publication based on rules, that's a planned extension — not shipped yet.
Limits and pacing
- Latency: up to 60 minutes from source publication to your DM. Acceptable for deal content; we trade realtime for lower risk on the scraping account.
- Scrape limit: 100 messages per source per cycle. If a source publishes more than 100 in 1 hour, you get a "backlog saturated" alert and some posts may be skipped.
- Candidate TTL: 24 hours. If you don't tap any button within 24h, the preview expires automatically (edited to "⏰ Expired").
Multi-tenant isolation
Each admin using Channel Monitor sees only their own sources, destinations, and candidates. Two users with the same source channel (@chollometro) will each receive their own independent DM preview with their own affiliate URL. No cross-owner leaking at any level (database queries, callback validation, middleware).