Recruiting Telegram feed: add inline "Get Started" button to rmcircle.team
sendTelegram() takes an optional reply_markup; the recruiting posts carry an inline URL button (🚀 Get Started — rmcircle.team) under every event, so the busy new-members feed converts attention into clicks to the home page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -92,12 +92,13 @@ function submitRateLimited(ip) {
|
|||||||
// Post to the team Telegram. topicId overrides the default team-build topic
|
// Post to the team Telegram. topicId overrides the default team-build topic
|
||||||
// (config.telegramTopicId) — used to fan the same event out to a second forum
|
// (config.telegramTopicId) — used to fan the same event out to a second forum
|
||||||
// topic (e.g. the recruiting/new-members topic) with different copy.
|
// topic (e.g. the recruiting/new-members topic) with different copy.
|
||||||
function sendTelegram(text, topicId) {
|
function sendTelegram(text, topicId, replyMarkup) {
|
||||||
const c = getConfig();
|
const c = getConfig();
|
||||||
if (!c.telegramBotToken || !c.telegramChatId) return;
|
if (!c.telegramBotToken || !c.telegramChatId) return;
|
||||||
const payload = { chat_id: c.telegramChatId, text };
|
const payload = { chat_id: c.telegramChatId, text };
|
||||||
const thread = topicId != null ? topicId : c.telegramTopicId;
|
const thread = topicId != null ? topicId : c.telegramTopicId;
|
||||||
if (thread && /^[0-9]+$/.test(String(thread))) payload.message_thread_id = Number(thread);
|
if (thread && /^[0-9]+$/.test(String(thread))) payload.message_thread_id = Number(thread);
|
||||||
|
if (replyMarkup) payload.reply_markup = replyMarkup;
|
||||||
fetch(`https://api.telegram.org/bot${c.telegramBotToken}/sendMessage`, {
|
fetch(`https://api.telegram.org/bot${c.telegramBotToken}/sendMessage`, {
|
||||||
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify(payload)
|
body: JSON.stringify(payload)
|
||||||
@@ -684,7 +685,7 @@ chain.startIndexer(evt=>{
|
|||||||
sendTelegram(text);
|
sendTelegram(text);
|
||||||
// recruiting-framed copy of the SAME event to the new-members topic
|
// recruiting-framed copy of the SAME event to the new-members topic
|
||||||
// (social proof, CTA -> home). Fires only when a recruit topic is set.
|
// (social proof, CTA -> home). Fires only when a recruit topic is set.
|
||||||
if(c.telegramRecruitTopicId){ const rm=recruitMsg(evt); if(rm) sendTelegram(rm, c.telegramRecruitTopicId); }
|
if(c.telegramRecruitTopicId){ const rm=recruitMsg(evt); if(rm) sendTelegram(rm, c.telegramRecruitTopicId, {inline_keyboard:[[{text:'🚀 Get Started — rmcircle.team',url:'https://rmcircle.team/?utm_source=tg'}]]}); }
|
||||||
// admin email alert — same team-gated events, so deep-leg action still surfaces
|
// admin email alert — same team-gated events, so deep-leg action still surfaces
|
||||||
if(c.teamAlertEmail){
|
if(c.teamAlertEmail){
|
||||||
const subj=evt.type==='registered'?`RM Circle team build: #${evt.id} registered under #${evt.referrerId}`
|
const subj=evt.type==='registered'?`RM Circle team build: #${evt.id} registered under #${evt.referrerId}`
|
||||||
|
|||||||
Reference in New Issue
Block a user