- Stars as a second payment method for passes and credit packs, next to
Lightning (STARS_ENABLED, prices in [stars_prices] / STARS_PRICES, set
on their own). Invoices in XTR with no provider token and one price;
pre-checkout checks payer, state, currency and amount;
successful_payment settles through the same transaction as Lightning,
so entitlement is identical. Idempotent by telegram_payment_charge_id
(unique index).
- Migration 00009: payment_method on purchases and ledger entries, plus
stars_amount, tg_charge_id and refunded_at on purchases. Stars
purchases never reach LNbits.
- Chat: buy screen, /credits, /account and the over-limit offer show
Lightning first and a Pay with Stars button.
- Mini App: Lightning and Stars switch on Buy; Stars use
createInvoiceLink and WebApp.openInvoice, confirmed by the server-side
payment event.
- Owner /refund <purchase or charge ID> calls refundStarPayment and takes
back the credits or pass; refunded_payment messages do the same once.
/stats shows revenue by payment method.
- The sats referral reward counts Lightning purchases only.
- The bot now asks Telegram for pre_checkout_query updates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Referral links carry a random 8 character base32 code (rf_<code>)
built from the bot username from getMe. Old ref_<id> links still work
but are never shown.
- The reward (REFERRAL_REWARD_SATS, old name REFERRAL_REWARD still read)
is paid through the ledger once the invited user's first purchase
settles, once per invited user, never for self-referrals.
- REFERRAL_DAILY_CAP limits what an inviter earns per UTC day; rewards
above it wait as pending and are paid on a later day by the billing
loop.
- /referral shows invited, converted, earned and pending, with Share,
Copy link and QR code buttons. The Mini App Me page mirrors it.
- Migration 00008: users.ref_code (unique) and referral_rewards,
backfilled from earlier referral credits in the ledger.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- /help: a short introduction with the user's default format, how to be
asked every time and the limits on one line, plus buttons Commands,
Account, Groups, Open app and Upgrade that switch the same message to
a section. Group commands are hidden in private chats; "Add me to a
group" takes their place.
- /quality: Ask every time, Best that fits my limit, Best, 1080p, 720p,
480p and Audio only, with the active one checked. Free users see which
qualities may go over their limit.
- /history: pages of five compact buttons (site, title, format, when),
a view per download with Send again, Thumbnail, Remove from history,
and Clear history with a confirmation. Thumbnails are grouped under
their video. Migration 00007 stores extractor, title, uploader and
profile on deliveries and adds a hidden flag.
- docs/SCREENS.md shows every screen in en, es and nl, generated by the
language test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>