Tools: Promote-on-Telegram section (Mini App links, posts, team setup swipe)

/tools#telegram: the member's t.me/RMCircleBot/join?startapp=YOURID links
(moving + 4 angles, self-preview tip), a paste-ready group post and warm DM,
and the connect-your-team setup message to forward (teach-forward). tools.js
personalize() now also fills YOURID tokens. Chatbot canned answer + AI prompt
synced.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-08-23 07:22:00 -05:00
parent 29ec8e82a1
commit 131fa8ae2a
4 changed files with 82 additions and 4 deletions
+9 -2
View File
@@ -18,16 +18,23 @@
// in both the copy payloads and the visible previews. ID comes from ?id=
// (dashboard hand-off), then localStorage, then the "Your link" box.
const BARE=/https:\/\/rmcircle\.team(?![\w./-])/g;
// YOURID marks Telegram Mini App links (t.me/...?startapp=YOURID[_angle]).
function fill(text,mine,id){
let out=text;
if(mine)out=out.replace(BARE,mine);
if(id)out=out.replace(/YOURID/g,id);
return out;
}
function personalize(){
const id=(idIn&&idIn.value||'').replace(/\D/g,'').slice(0,15);
const mine=id?`https://rmcircle.team/join/${id}`:null;
document.querySelectorAll('.copy-btn').forEach(b=>{
if(b.dataset.orig===undefined)b.dataset.orig=b.getAttribute('data-copy')||'';
b.setAttribute('data-copy', mine?b.dataset.orig.replace(BARE,mine):b.dataset.orig);
b.setAttribute('data-copy', fill(b.dataset.orig,mine,id));
});
document.querySelectorAll('pre.swipe').forEach(p=>{
if(p.dataset.orig===undefined)p.dataset.orig=p.textContent;
p.textContent= mine?p.dataset.orig.replace(BARE,mine):p.dataset.orig;
p.textContent=fill(p.dataset.orig,mine,id);
});
const note=document.getElementById('personalNote');
if(note){