Mini App join funnel: startapp sponsor attribution + wallet-app handoff
- /app decodes startapp=<sponsorId>[_<angle>] -> unlinked visitors land on the sponsor squeeze page /join/<ref>?src=miniapp (linked members still go to their dashboard); no-invite prospects get a gold Join button -> /join-now - tg-app.js: sync __rmcInTg flag; external links route out of the webview via openLink/openTelegramLink (wallet deep links reach the wallet app reliably) - join-now.js in the webview leads with the MetaMask/Trust deep links (no injected wallet can exist there); ref + src survive into the wallet browser - tgbot: links command + weekly digest include the t.me/<bot>/<short>?startapp Telegram-native invite once config.miniAppShortName is set (new PATCH key) - Synced chat.js canned answer + AI prompt (prospects can join from the app) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -191,7 +191,8 @@ async function digestFor(memberId) {
|
||||
lines.push(`📊 READ: ${st.downCount != null ? st.downCount : '—'} in your org${delta != null ? ` (${delta >= 0 ? '+' + delta : delta} this week)` : ''} · ${Math.round(st.downPol || 0).toLocaleString()} POL earned below you`);
|
||||
lines.push(mover ? `🔥 LIFT ONE: #${mover.id} — ${mover.ascensusCost ? 'their next step is already covered by catches; one message converts it' : 'money is forming below them; a heads-up now beats a pass-up later'}. Try: msg ${mover.id} <your note>` : `🔥 LIFT ONE: nobody flagged this week — congratulate your newest member instead.`);
|
||||
lines.push(quiet ? `🕯️ CHECK ONE: #${quiet.id} — one kind line, no pressure: msg ${quiet.id} Thinking of you — no rush on anything, here if you need me.` : `🕯️ CHECK ONE: your quiet list is empty. Enjoy that.`);
|
||||
lines.push(`📤 SHARE ONE: this week's angle is "${angle}" — your matched link:\nhttps://rmcircle.team/join/${memberId}?v=${angle}`);
|
||||
const maShare = miniAppInvite(memberId, angle);
|
||||
lines.push(`📤 SHARE ONE: this week's angle is "${angle}" — your matched link:\nhttps://rmcircle.team/join/${memberId}?v=${angle}${maShare ? `\nSharing inside Telegram? Use this instead — it opens right here:\n${maShare}` : ''}`);
|
||||
lines.push(`\nThen close the tab. 20 every week beats 2 hours twice. (Lesson 10: ${lessonLink(10)})\nrhythm off to stop these · rhythm now to rerun anytime`);
|
||||
return lines.join('\n');
|
||||
}
|
||||
@@ -216,10 +217,20 @@ async function runDigests() {
|
||||
}
|
||||
|
||||
// --- member commands --------------------------------------------------------
|
||||
// t.me/<bot>/<shortname>?startapp=<id>[_<angle>] — the Telegram-native invite;
|
||||
// app.js decodes start_param and routes prospects to the sponsor's squeeze
|
||||
// page. Requires config.miniAppShortName (set after BotFather /newapp).
|
||||
function miniAppInvite(id, angle) {
|
||||
const d = load(), short = String(getConfig().miniAppShortName || '').trim();
|
||||
if (!d.u || !short) return null;
|
||||
return `https://t.me/${d.u}/${short}?startapp=${id}${angle ? '_' + angle : ''}`;
|
||||
}
|
||||
function linksText(id) {
|
||||
const b = 'https://rmcircle.team';
|
||||
const ma = miniAppInvite(id);
|
||||
return `🔗 Your links, #${id} (each one credits YOU):\n\n` +
|
||||
`Moving invite link (routes to whoever needs help next in your leg):\n${b}/join/${id}\n\n` +
|
||||
(ma ? `⚡ Telegram-native invite — opens instantly INSIDE Telegram (best for sharing in groups and DMs here):\n${ma}\n\n` : '') +
|
||||
`Angle-matched links — pick the hook that fits your person:\n` +
|
||||
`💸 Pocket Change: ${b}/join/${id}?v=pocket\n` +
|
||||
`📱 Your Phone: ${b}/join/${id}?v=phone\n` +
|
||||
|
||||
Reference in New Issue
Block a user