Phase 5: Telegram affiliate program

- docs/AFFILIATE.md: the owner's setup in Telegram (profile editor or
  BotFather's Mini App), commission and duration rules (raise only, end
  with commission 0, about 24 hours), who counts as referred, the link
  formats, and the no-double-rewards rule. Checked against Telegram's
  current pages.
- Affiliate purchases go through Stars invoices inside the Mini App
  (createInvoiceLink and WebApp.openInvoice, from Phase 4).
- /start accepts any payload; only our own rf_ (and old ref_) links set
  an inviter. A test sends payloads of every shape, Telegram's affiliate
  prefix included.
- Mini App Me page: an Earn section explaining both programs, with how
  to join Telegram's from the bot's profile, behind AFFILIATE_ENABLED.
  No affiliate numbers are computed or shown.
- /referral notes that Stars purchases earn through Telegram's program.
- The optional MTProto CLI is left out, with the reason in the docs.
- The Mini App browser test checks the Earn section in en, es and nl.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Michilis
2026-11-18 21:31:06 +00:00
co-authored by Claude Opus 5.5
parent 2b5625e9d4
commit d64db03f21
20 changed files with 341 additions and 9 deletions
+11
View File
@@ -858,6 +858,16 @@ one = "Usage, last day"
other = "Usage, last {{.Count}} days"
[app.me]
affiliate_open = "Open the bot's profile"
affiliate_step3 = "Copy the link Telegram gives you and share it."
affiliate_step2 = "Tap the affiliate program and join it."
affiliate_step1 = "Open the profile of {{.Bot}} in Telegram."
affiliate_text = "Share a Telegram affiliate link to this app. When somebody opens the app for the first time through your link, you get a share of the Stars they spend in it, for as long as the program says."
affiliate_note = "Telegram runs this program and pays your share in Stars. You see what you earn in Telegram, not here."
affiliate_title = "Telegram affiliate program"
earn_note_both = "There are two ways to earn. Our own referral pays you sats when people you invite buy over Lightning. Telegram's affiliate program pays you a share of the Stars they spend in this app. A purchase counts for one of the two, never both."
earn_note_sats = "Invite friends with your link. When somebody you invited pays for a first purchase over Lightning, you get sats in credits."
earn_title = "Earn"
qr = "QR code"
pending = "Waiting for the daily cap"
earned = "Earned"
@@ -919,6 +929,7 @@ one = "Remove {{.Count}} download from your history? Files already in this chat
other = "Remove all {{.Count}} downloads from your history? Files already in this chat stay where they are."
[referral]
affiliate_note = "Purchases paid with Telegram Stars do not count here: they earn through Telegram's affiliate program. You join it from the profile of @{{.Bot}} in Telegram."
qr_caption = """
Your invite link as a QR code:
{{.Link}}"""
+11
View File
@@ -833,6 +833,16 @@ one = "Uso, último día"
other = "Uso, últimos {{.Count}} días"
[app.me]
affiliate_open = "Abrir el perfil del bot"
affiliate_step3 = "Copia el enlace que te da Telegram y compártelo."
affiliate_step2 = "Toca el programa de afiliados y únete."
affiliate_step1 = "Abre el perfil de {{.Bot}} en Telegram."
affiliate_text = "Comparte un enlace de afiliado de Telegram a esta app. Cuando alguien abre la app por primera vez con tu enlace, recibes una parte de las Estrellas que gasta en ella, durante el tiempo que indique el programa."
affiliate_note = "Telegram gestiona este programa y te paga tu parte en Estrellas. Lo que ganas lo ves en Telegram, no aquí."
affiliate_title = "Programa de afiliados de Telegram"
earn_note_both = "Hay dos formas de ganar. Nuestro programa de referidos te paga sats cuando las personas que invitas compran por Lightning. El programa de afiliados de Telegram te paga una parte de las Estrellas que gastan en esta app. Una compra cuenta para uno de los dos, nunca para ambos."
earn_note_sats = "Invita a tus amigos con tu enlace. Cuando alguien que invitaste pague una primera compra por Lightning, recibes sats en créditos."
earn_title = "Gana"
qr = "Código QR"
pending = "En espera del tope diario"
earned = "Ganado"
@@ -892,6 +902,7 @@ one = "Quitar {{.Count}} descarga de tu historial? Los archivos que ya están en
other = "Quitar las {{.Count}} descargas de tu historial? Los archivos que ya están en este chat se quedan donde están."
[referral]
affiliate_note = "Las compras pagadas con Estrellas de Telegram no cuentan aquí: generan ganancias con el programa de afiliados de Telegram. Te unes desde el perfil de @{{.Bot}} en Telegram."
qr_caption = """
Tu enlace de invitación como código QR:
{{.Link}}"""
+11
View File
@@ -832,6 +832,16 @@ one = "Gebruik, afgelopen dag"
other = "Gebruik, afgelopen {{.Count}} dagen"
[app.me]
affiliate_open = "Profiel van de bot openen"
affiliate_step3 = "Kopieer de link die Telegram je geeft en deel hem."
affiliate_step2 = "Tik op het affiliateprogramma en doe mee."
affiliate_step1 = "Open het profiel van {{.Bot}} in Telegram."
affiliate_text = "Deel een affiliatelink van Telegram naar deze app. Als iemand de app voor het eerst via jouw link opent, krijg je een deel van de Stars die diegene erin uitgeeft, zo lang als het programma aangeeft."
affiliate_note = "Telegram regelt dit programma en betaalt je deel uit in Stars. Wat je verdient zie je in Telegram, niet hier."
affiliate_title = "Affiliateprogramma van Telegram"
earn_note_both = "Er zijn twee manieren om te verdienen. Ons eigen uitnodigingsprogramma betaalt je sats als mensen die je uitnodigt via Lightning kopen. Het affiliateprogramma van Telegram betaalt je een deel van de Stars die zij in deze app uitgeven. Een aankoop telt voor een van de twee, nooit voor allebei."
earn_note_sats = "Nodig vrienden uit met je link. Als iemand die je uitnodigde een eerste aankoop via Lightning betaalt, krijg jij sats aan tegoed."
earn_title = "Verdienen"
qr = "QR-code"
pending = "Wacht op de daglimiet"
earned = "Verdiend"
@@ -891,6 +901,7 @@ one = "{{.Count}} download uit je geschiedenis halen? Bestanden die al in deze c
other = "Alle {{.Count}} downloads uit je geschiedenis halen? Bestanden die al in deze chat staan blijven staan."
[referral]
affiliate_note = "Aankopen die met Telegram Stars zijn betaald tellen hier niet mee: die leveren iets op via het affiliateprogramma van Telegram. Je doet mee via het profiel van @{{.Bot}} in Telegram."
qr_caption = """
Je uitnodigingslink als QR-code:
{{.Link}}"""