Description
A bot that runs a Telegram deals channel by itself. Every half hour it pulls products from the Shopee affiliate API, drops the ones that fail a quality cut, scores the rest and posts the best one with a photo and a tracked link. A small panel shows who joined and left, clicks per day and the offers people clicked most.
Features
- Offers scored by sales, rating, discount and commission, each one normalized against the rest of the batch
- A hard cut before any scoring: rating 4.5 or higher, at least 100 sold, 15% off, and a blocklist matched on whole words with accents removed
- No product repeats within 14 days, and two posts in a row never come from the same category
- A short-link redirector that counts clicks and ignores the preview bots of Telegram, WhatsApp and other apps
- Paste a link from Amazon, Shopee or Mercado Livre and the store is detected and the affiliate link checked before posting
- A panel with members, joins and leaves, a 30-day curve and the top five offers, in light and dark themes
Challenges
- Signing every request to the Shopee GraphQL API with a SHA-256 of app id, timestamp, payload and secret, and turning errors that come back inside the response body into real exceptions
- Keeping member history Telegram does not store: a daily snapshot of the count plus a webhook that records each join and leave
- Choosing from a catalog of about a thousand products without posting the same handful over and over
Learnings
- That a link preview is a request like any other, so a click counter without a user-agent filter counts the chat app before it counts a person
- That sales need a log before they are normalized, or one product with ten thousand orders flattens rating and discount for the whole batch
- That checking a deploy once, right after it starts, reports a 502 for a healthy container because the proxy reaches it a few seconds later; the deploy script now waits for a 200