- One message per job: the status message is deleted once the file is
sent, or shortened to "Sent." when Telegram keeps it.
- No reply quotes in private chats; groups keep them.
- Queue status only mentions the position when the wait is above
QUEUE_NOTICE_THRESHOLD_SECONDS or somebody is ahead. Status edits are
throttled to one per 2.5 s per message; a state that arrives too soon
is shown later instead of dropped. The wait estimate is 0 with a free
slot.
- Caption with title (uploader and date when generic), uploader,
duration, a short source link without tracking parameters and an
optional "via @bot" line (CAPTION_ATTRIBUTION). Uploaded videos get a
320 px JPEG thumbnail; merged MP4s are written with faststart.
- Buttons under the result: Audio (MP3), Other quality, Thumbnail,
Delete. Requester only in groups.
- Language resolved once per update and passed in the context. A
fallback to English is logged as a bug; a test walks every screen in
Spanish and Dutch. Language picker on the first /start.
- Sizes without a zero decimal ("50 MB").
- First link of a new user shows the card once and sets the default to
"best that fits my limit".
- Errors offer the next step (Try again, Smaller quality, Upgrade, Open
app); passing lookup failures are retried once.
- Up to MULTI_LINK_MAX links per message; a link sent a moment ago gets
"already sent" with a Send again button.
- Mini App menu button, labelled per private chat in the user's
language.
- Personal /settings in private chats with an "Add me to a group"
button.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4.2 KiB
4.2 KiB
Update notes: flows, Stars, affiliate program
What I found in the repository before changing it, and what this round of work changes. Decisions made on the way are recorded in ASSUMPTIONS.md under "Update round".
What is there
- Shape.
cmd/core(Telegram, DB, queue, HTTP) andcmd/worker(yt-dlp, ffmpeg). The core embeds a worker by default. See ARCHITECTURE.md. - Bot front end (
internal/bot).bot.goroutes updates and holds the send and edit helpers.commands.godispatches commands,card.goruns the link flow (placeholder, probe, card, start),status.gokeeps the status message current with a throttle,deliver.gosends files,money.gocovers buying, offers and fulfilment,groups.gocovers group admin commands and personal preferences,extras.gocovers playlists, subtitles and history,live.gothe HTML widgets,appops.gothe Mini App operations. - Language.
actorForalready resolves the language once per update: the stored choice, then Telegram'slanguage_code, then English. A group's own language wins in that group. Handlers take the result asact.lang. Catalogs arelocales/{en,es,nl}.toml. The catalog tests already check for missing keys, placeholders and unused messages. - Errors. yt-dlp output is classified in
internal/ytdlp/classify.gointo codes with anerror.<code>message each. A retryable job failure is retried once by the scheduler. Lookups are not retried. - Entitlement (
internal/entitle) is a pure resolver.service.Startandservice.Previeware the single gate for all paths: chat, Mini App, cache hits and resends. - Billing (
internal/billing) is Lightning only (LNbits), with a wallet and ledger per user or group, passes, credits, one-off payments, gift codes and Cashu. - Referrals store the inviter's Telegram ID from
/start ref_<id>. Only the count is shown and nothing is rewarded yet, although theREFERRAL_REWARDsetting exists. - Mini App (
web/miniapp, React and Vite, built intodist/and embedded). Pages: Home, Queue, History, Buy, Me (Profile.tsx), Groups. The API is ininternal/api/miniapp.go. - Tests run the real core against a fake Bot API
(
internal/tg/fakeserver) and a scripted yt-dlp, on SQLite by default and on Postgres withDLBOT_TEST_DB=postgres.
Flow problems found
- A finished download leaves two messages: the file, and the card edited to "Done. Enjoy." under it.
- Every answer in a private chat quotes the user's message.
- A job that starts at once still shows "In the queue. Position 1".
- Phase changes skip the edit throttle, so a fast job can edit its status several times a second.
- The caption is only the title. There is no source link, and no
thumbnail is uploaded with videos. Merged MP4 files are not written
with
faststart. /settingsrefuses in a private chat.- Sizes read "50.0 MB".
- Errors are text only, with no next step.
- At most 3 links per message. The same link sent twice is downloaded twice.
- Referral links show the raw Telegram user ID.
What changes, by phase
- Quick flow fixes. One status message per job that is removed once
the file is sent. No reply quotes in private chats. Quieter queue
status and a strict 2.5 s edit throttle. A full caption with a cleaned
source link, an optional
via @botline, and a thumbnail for uploaded videos. Buttons under the result. Personal/settings. Localized menu button. Error buttons and one automatic retry of lookups. Up to N links per message, with "Already sent" for repeats. First-run quality prompt. A strict language test. - Command screens. Sectioned
/help, a reworked/qualitywith "Best that fits my limit", and a paginated/historywith richer rows. - Own referral system. Short random codes, rewards paid only after a first settled Lightning purchase, and a daily cap.
- Telegram Stars. A second payment method next to Lightning: invoices in XTR, pre-checkout, successful payment, refunds, and a per-method price table.
- Telegram affiliate program. Owner docs, Mini App Stars invoices,
tolerant
/startpayload handling, and an Earn section. - Inline mode and polish (optional).