diff --git a/tgbot.js b/tgbot.js index 05dc522..6607a60 100644 --- a/tgbot.js +++ b/tgbot.js @@ -282,7 +282,17 @@ async function handleUpdate(update) { await dm(chatId, `โœ… Linked to position #${rec.id}!\n\nFrom now on:\n๐Ÿ’ฐ You get a DM the moment your position catches a payment\n๐Ÿ“จ Team messages reach you here โ€” reply to answer\n๐ŸŽ‰ You're pinged when someone joins on your link\n\nTry: coach ยท team ยท links โ€” or: msg \n๐Ÿ“ฑ Tap the โ˜ฐ menu button (next to the message box) to open your full dashboard right inside Telegram โ€” no login needed.\nYour weekly 20-minute digest arrives Saturdays 10am Central (rhythm to adjust).`); return; } - await dm(chatId, `That link code is expired or already used. Get a fresh one from the Messages panel on your dashboard: https://rmcircle.team/my`); + // A dead code from someone who is ALREADY linked is not a failure โ€” it + // is usually a stale link they tapped twice, or an old one left over + // from an earlier attempt. Telling them it "expired" right after we + // confirmed their link reads as a contradiction and sends them back to + // the dashboard to redo something that is already done. + const already = chatMember(chatId); + if (already) { + await dm(chatId, `โœ… You're already linked to position #${already} โ€” nothing more to do.\n\nThat code was an older one (link codes are single-use), but your link is active. Try: coach ยท team ยท links\n๐Ÿ“ฑ Tap the โ˜ฐ menu button next to the message box for your full dashboard.`); + return; + } + await dm(chatId, `That link code has expired or was already used โ€” they're single-use and short-lived.\n\nGrab a fresh one: open https://rmcircle.team/my โ†’ Messages โ†’ sign in with your wallet โ†’ "Connect Telegram", and use the newest link.`); return; } await dm(chatId, `๐Ÿ‘‹ This is the RM Circle companion bot.\n\nTo link your position: open your dashboard (https://rmcircle.team/my), sign in to Messages with your wallet, and tap "Connect Telegram". That proves the position is yours โ€” no passwords.\n\nOnce linked you get payout pings, team messages, and your share links right here.`);